AngularJS:错误:未知提供程序
AngularJS: Error: Unknown provider
简单的事情-在jsfiddle中工作,但在我的文件中不工作。我正在尝试将一些数据添加到模块的"工厂"中,然后在我的控制器中使用它。这是相关代码:
var challengesApp = angular.module('challengesApp', []);
challengesApp.factory('Challenges', function() {
var challenges = [
{
'program': {
"num": "1",
"name": "aaa"
},
'challengeDesc': "desss",
'items': [
{title:"aaa",
desc:"bbb",
link: "www.google.com",
fiction: true},
]
}
];
return challenges;
});
function ChallengeCtrl($scope, Challenges) {
$scope.challenges = Challenges;
etc...
}
function ChallengeListCtrl($scope, Challenges) {
$scope.challenges = Challenges;
etc..
}
和HTML:
<body ng-app="challengesApp">
<div ng-controller="ChallengeCtrl">
<div id="question">
<h2>{{ challenge.challengeDesc }}</h2>
<ul>
<li ng-repeat="item in challenge.items">
<strong>{{ item.title }}</strong> - {{ item.desc }}
</li>
</ul>
</div>
</div>
<div ng-controller="ChallengeListCtrl">
<div id="programs_list">
<ul>
<li ng-repeat="program in challenges | orderBy:orderProp:reverse">
<a href="" ng-click="changeChallenge(program)">
{{ program.program.num }} - {{ program.program.name }}
</a>
</li>
</ul>
</div>
</div>
<script src="js/main.js"></script>
</body>
这里有我遗漏的东西吗?
所以,正如我所怀疑的,这是一个愚蠢的错误。<html>
标签为:
<html ng-app>
在CCD_ 3标签处阻塞正确的CCD_。
相关文章:
- 为什么我得到错误:$injector:unp未知提供程序
- 在出厂时注入服务错误: [$injector:unpr] 未知提供程序: $scopeProvider <- $scop
- AngularJS错误:$injector:unp未知提供程序-$modalInstanceProvider
- AngularJS:未知的提供程序错误
- Angular小部件中的Angular Grid返回错误:[$injector:unp]未知提供程序:
- 有角度的“;未知提供者”;在约曼应用程序中使用Grunt Build缩小后出错
- 获取解析值的未知提供程序错误
- $provide.decorator为指令提供未知的提供程序
- jQuery - 追加/替换事件侦听器(当事件处理程序未知时)
- angular.js:13294错误:[$injector:unp]未知提供程序:cityResourceProvide
- 角度未知提供程序,无法POST/注册
- 未知提供程序:在angular.bootstrap之前使用$injector获取$location服务时使用$rootE
- Watir Web驱动程序引发未知Javascript错误
- ionic.bundle.js:25642错误:[$injector:unp]未知提供程序:$cordovaGeoloc
- 密钥斗篷未知提供程序错误
- Angular 未知提供程序,出厂时包装在匿名函数中
- ui选择未知提供程序
- 错误: [$injector:unpr] 未知提供程序: setPageProvider <- setPage
- 错误:[$injector:unp]在控制器中注入routeprovider服务时,jasmine测试中的提供程序未知
- uib模态提供程序未知单元测试