我尝试添加自定义过滤器,但如果我使用以下代码:
angular.module('myApp',[]).filter('startFrom', function() {
return function(input, start) {
start = +start; //parse to int
return input.slice(start);
}
});
但如果我这样做,我会在 Firebug 中得到:“ReferenceError: angular is not defined”。
应用程序的其余部分工作正常,我在标签 html 中而不是标签 html 中使用 ng-app,并且 https://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.js
最佳答案
在包含任何其他 js 文件之前,您应该首先放置包含 Angular 线
关于javascript - AngularJs 引用错误 : angular is not defined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14260399/