Angularjs   发布时间:2022-04-20  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了angularjs – 为什么我不能在我的config()中注入$location?大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
为什么这给我一个错误
angular.module('app').config(function($routeProvider,$LOCATIOnProvider,$httpProvider,$LOCATIOn) {

但这行不行?

angular.module("app").factory("Someresource",function($q,$resource,$http,$LOCATIOn,Authenticationservice,Base64) {

这是同一个应用程序可以配置只能获得提供者,工厂只能获得非提供者?

只有提供者和常量可能被注入到配置块中。

配置块基本上是在将提供者注入控制器,服务,工厂等之前配置的地方。

angular.module('mymodule',[]).
 config(function(injectables) { // provider-injector
   // This is an example of config block.
   // You can have as many of these as you want.
   // You can only inject Providers (not instances)
   // into the config blocks.
 }).
 run(function(injectables) { // instance-injector
   // This is an example of a run block.
   // You can have as many of these as you want.
   // You can only inject instances (not Providers)
   // into the run blocks
 });

大佬总结

以上是大佬教程为你收集整理的angularjs – 为什么我不能在我的config()中注入$location?全部内容,希望文章能够帮你解决angularjs – 为什么我不能在我的config()中注入$location?所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。