Error: [ng:areq] Argument 'xxxx' is not a function, got undefined
"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 'xxxx' is not a function, got undefined的更多相关文章
- Error: [ng:areq] Argument ‘AppCtrl’ is not a function, got undefined
今天把用ionic做一个案例,和ionic示例项目差不多,只是用requirejs分离了controller,但是一直报错 Error: [ng:areq] Argument ‘AppCtrl’ is ...
- 【AngularJs】---"Error: [ng:areq] Argument 'fn' is not a function, got undefined"
项目中把controller.service抽取出来 一步一步没有报错 index那里加 <script src="js/controllers/XXController.js&quo ...
- Error: [ng:areq] Argument 'LoginCtrl' is not a function, got undefined
- [ng:areq] Argument 'XXXXCtrl' is not a function, got undefined
angular.module('MyApp', []) 这里的[]重复了,以后引入新的controller.js文件会覆盖前面那个,所以此处的[]去掉 .controller('MyCtrl', fu ...
- Error: [ng:areq]
错误描述:Error: [ng:areq] http://errors.angularjs.org/1.4.8/ng/areq?p0=HelloCtrl&p1=not%20a%20functi ...
- Argument 'xxx' is not a function, got undefined,初学Angular的第一个坑
终于考完试了,在没更新的这一段时间里,一直都在忙于应付考试.不过在期间也是接触到不少好玩的东西,比如Html5的Canvas,我用lufylegend的Html5引擎做了个<看你有所色>的 ...
- angular Error: [ng:areq]
在使用augularjs的时候,爆了个错误: 后来经过对比,原来是我的<html>标签多了点东西
- angular.min.js:118 Error: [ng:areq] http://errors.angularjs.org/1.5.8/ng/areq?
1,错误如图所示 简单说下错误原因是:没有js没有注册进去. 解决方法: 1.看下index.html有没有引入你的js文件. 2.看下app.js有没有注册js,比如我这次就是这步没做好,合并代码时 ...
- AngularJS中angular.min.js:80 Error: [ng:areq] http://errors.angularjs.org/1.2.9/ng/areq
报出来的时候,出现这种错误,是因为在引入控制器的时候没有引入成功,我遇到这个错误是在因为没有将父控制器引入到子控制器中.
随机推荐
- shell命令bc
简介 bc支持浮点数的精度运算(Bash不支持浮点数运算) 运行方式 一.CLI 二.PIPE 示例 一.浮点数运算 变量scale:设置小数点后面的位数 # 默认scale=0 echo &quo ...
- POJ2456 Aggressive cows
Aggressive cows 二分,关键是转化为二分! #include <cstdio> #include <algorithm> ; ; int N, C; int a[ ...
- EF 知识点
EntityFrameWorak知识点记录 发展史 EF1.0时,只支持Database First,数据库优先.必须将设计器指向一个现有的数据库. EF4时,支持Model First,模型优先.可 ...
- Session对象
Session对象用于存储在多个页面调用之间特定用户的信息.Session对象只针对单一网站使用者,不同的客户端无法互相访问.Session对象中止于联机机器离线时,也就是当网站使用者关掉浏览器或超过 ...
- CF 370B Berland Bingo
题目链接: 传送门 Berland Bingo time limit per test:1 second memory limit per test:256 megabytes Descrip ...
- TcpClient类与TcpListener类
TcpClient类 //构造方法1 TcpClient t = new TcpClient(); t.Connect(); //构造方法2 IPEndPoint iep = ); TcpClient ...
- ubuntu 设置hostname
永久修改hostname: # sudo vim /etc/hostname # sudo vim /etc/hosts
- 【Beta】Scrum02
Info *由于28日大家事情比较多,推迟了一天 时间:2016.11.29 21:30 时长:10min 地点:大运村1号公寓5楼楼道 类型:日常Scrum会议 NXT:2016.12.01 21: ...
- BZOJ1085: [SCOI2005]骑士精神
传送门 dfs+A*优化. A*是人工智能算法,属于启发式搜索的一部分.第一次知道这个名词是在写虫食算的时候闵神说这个用A*搞跑的比谁都快..但是当时搜了很多资料想搞清楚这个东西,但是当时还是太拿衣服 ...
- 卸载自己编译的程序(ubuntu14.04)
cd 源代码目录make clean./configuremake uninstall