Error: [ng:areq] Argument 'xxxx' is not a function, got undefined
2016-10-28 15:27
1146 查看
"Error: [ng:areq] Argument 'keywords' is not a function, got undefined"
代码类似这样的:
<div ng-app="xxxx" ng-controller="xxxx"> //... </div>
var app = angular.module("xxxx", []); app.controller('xxxx', function ($scope, $http, $state) {});
本来应该不会有问题,但是经过路由配置之后,就出现了这样的问题,我完全就是新建了一个页面,
然后复制一下html和js文件而已,怎么会报错呢...结果问了下对Angular熟悉的人才知道:该这么配置...
第一种解决方案:要么在路由配置那里写入:
var app = angular.module('app', ["old_1", "old_2", "old_3", "xxxx"]);
第二种解决方案:要么修改新建的页面和js:
<div ng-controller="xxxx"> //... </div>
app.controller('xxxx', function ($scope, $http, $state) {});
好吧、我选的第二种,能扩展的别修改,GG。。。
相关文章推荐
- Error: [ng:areq] Argument 'HelloCtrl' is not a function, got undefined
- 【AngularJs】---"Error: [ng:areq] Argument 'fn' is not a function, got undefined"
- Error: [ng:areq] Argument ‘AppCtrl’ is not a function, got undefined
- 【AngularJs】---"Error: [ng:areq] Argument 'fn' is not a function, got undefined"
- 用angularjs 模块时Error: [ng:areq] Argument 'controller' is not a function,
- Error: [ng:areq] Argument controller Name is not a function, got undefined angular js报错问题解决
- 【AngularJs】---"Error: [ng:areq] Argument 'fn' is not a function, got undefined"
- AngularJS Error: [ng:areq] loginController is not a function
- HelloWorld-Argument 'HelloController' is not a function, got undefined
- AngularJS--[ng:areq] Argument 'xxCtrl' is not a function, got undefined!错误
- Uncaught TypeError: UE.getEditor is not a function
- Uncaught TypeError: _react2.default.findDOMNode is not a function
- 小程序之坑一TypeError: this.setData is not a function
- Uncaught TypeError: $(...).on is not a function
- javascript 报错Uncaught TypeError: {(intermediate value)(intermediate value)} is not a function
- Uncaught TypeError: sum is not a function
- Uncaught TypeError: undefined is not a function
- 【疑难杂症01】TypeError: alert is not a function
- 关于 "Uncaught TypeError: Property 'submit' of object #<HTMLFormElement> is not a function" 的解决方案