[size=x-large]1.[$injector:modulerr] Failed to instantiate module ngRoute due to:[/size]
[img]http://dl2.iteye.com/upload/attachment/0111/4104/28dacf15-aa1b-30c2-8ea7-380d9ea263b0.png[/img]
[size=x-large]2.Error: [ng:areq] Argument 'xxxController' is not a function, got undefined[/size]
[img]http://dl2.iteye.com/upload/attachment/0111/4113/0cc4c41a-0d8c-37f6-9ea3-cd24b06f459a.png[/img]
[size=x-large]3.angular 官方js下载[/size]
//哎,百度我老是去找联网的引入方式。还是本地下下来玩吧,卸载不了,请留言
[url]http://cdn.angularjs.cn/angularjs/angularjs-latest.zip[/url]
[size=x-large]4.[$injector:nomod] Module 'myApp' is not available![/size]
[img]http://dl2.iteye.com/upload/attachment/0111/4305/12e8d086-abe9-3b96-ae1f-3d173f6ad675.png[/img]
[size=x-large]5.Error: xxxis not defined[/size]
[img]http://dl2.iteye.com/upload/attachment/0111/4310/35c3f934-ce9d-361b-9af2-09fa5fa4e015.png[/img]
[size=x-large]6.Uncaught Error: [$injector:nomod] Module 'niuApp.bank' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.[/size]
[img]http://dl2.iteye.com/upload/attachment/0112/0077/6ff4ff54-9eeb-383c-81c8-038c584ddf68.png[/img]
[size=x-large]7.$browser.addPollFn is not a function[/size]
[img]http://dl2.iteye.com/upload/attachment/0111/4104/28dacf15-aa1b-30c2-8ea7-380d9ea263b0.png[/img]
//angular-rounte.js错误or缺少
<script src="mylib/angular.js"></script>
<script src="mylib/angular-routee.js"></script>
[size=x-large]2.Error: [ng:areq] Argument 'xxxController' is not a function, got undefined[/size]
[img]http://dl2.iteye.com/upload/attachment/0111/4113/0cc4c41a-0d8c-37f6-9ea3-cd24b06f459a.png[/img]
//参考书上都是这样,应该是改版了,有知道的同学回复下,为什么这样?
function StartUpController($scope) {
$scope.computeNeeded = function() {
$scope.needed = $scope.startingEstimate * 10;
};
$scope.requestFunding = function() {
window.alert("Sorry, please get more customers first.");
};
}
//应该这样写
angular.module("a",[]).controller("StartUpController",function($scope){
$scope.computeNeeded = function() {
$scope.needed = $scope.startingEstimate * 10;
};
$scope.requestFunding = function() {
window.alert("Sorry, please get more customers first.");
};
})
[size=x-large]3.angular 官方js下载[/size]
//哎,百度我老是去找联网的引入方式。还是本地下下来玩吧,卸载不了,请留言
[url]http://cdn.angularjs.cn/angularjs/angularjs-latest.zip[/url]
[size=x-large]4.[$injector:nomod] Module 'myApp' is not available![/size]
[img]http://dl2.iteye.com/upload/attachment/0111/4305/12e8d086-abe9-3b96-ae1f-3d173f6ad675.png[/img]
script 导入文件错误,没找到ctrl.js
[size=x-large]5.Error: xxxis not defined[/size]
[img]http://dl2.iteye.com/upload/attachment/0111/4310/35c3f934-ce9d-361b-9af2-09fa5fa4e015.png[/img]
angular.module("myApp",[])
.value('realname','vlaue声明')
.constant('http', '常量constant声明')
.value('realname','vlaue声明,可以改变')
.constant('http', '常量constant声明,永远不可改变')
//自己定义的参数不要溜掉
//另外constant不可以改变数值
.controller('valueCtrl', function($scope,realname,http){
$scope.msg = "hello valueCtrl";
$scope.realname = realname;
$scope.http = http;
})
[size=x-large]6.Uncaught Error: [$injector:nomod] Module 'niuApp.bank' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.[/size]
[img]http://dl2.iteye.com/upload/attachment/0112/0077/6ff4ff54-9eeb-383c-81c8-038c584ddf68.png[/img]
引入js文件的地方,确保js文件名字正确,和js文件的顺序,被坑大了
[size=x-large]7.$browser.addPollFn is not a function[/size]
angular-cookies.js文件版本错误,确保js版本一致,最好1.4以上