Error: [ng:areq] Argument ‘AppCtrl’ is not a function, got undefined
今天把用ionic做一个案例,和ionic示例项目差不多,只是用requirejs分离了controller,但是一直报错
Error: [ng:areq] Argument ‘AppCtrl’ is not a function, got undefined
define(function (require) {
'use strict';
var controllers = angular.module('starter.controllers', []);
controllers.controller('appCtrl',require('controllers/appController'));
controllers.controller('dashCtrl',require('controllers/dashController'));
controllers.controller('gameCtrl',require('controllers/gameController'));
controllers.controller('meCtrl',require('controllers/meController'));
controllers.controller('infoCtrl',require('controllers/infoController'));
controllers.controller('playListCtrl',require('controllers/playListController'));return controllers;
});
经过一番折腾还是没能解决。后来我细分析,我的控制器叫appCtrl,错误信息中怎么是AppCtrl,我试着将名称首字母大写,卧槽,居然通过了
define(function (require) {
'use strict';
var controllers = angular.module('starter.controllers', []);
controllers.controller('AppCtrl',require('controllers/appController'));
controllers.controller('DashCtrl',require('controllers/dashController'));
controllers.controller('GameCtrl',require('controllers/gameController'));
controllers.controller('MeCtrl',require('controllers/meController'));
controllers.controller('InfoCtrl',require('controllers/infoController'));
controllers.controller('PlayListCtrl',require('controllers/playListController'));
return controllers;
});
再在网上搜,原来 ionic 的 ui-router 是大小写敏感,这里定义的控制器名要与路由中定义的控制器名大小写一致
Error: [ng:areq] Argument ‘AppCtrl’ is not a function, got undefined的更多相关文章
- Error: [ng:areq] Argument 'xxxx' is not a function, got undefined
"Error: [ng:areq] Argument 'keywords' is not a function, got undefined" 代码类似这样的: <div n ...
- 【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
报出来的时候,出现这种错误,是因为在引入控制器的时候没有引入成功,我遇到这个错误是在因为没有将父控制器引入到子控制器中.
随机推荐
- GDI+_SavePic
Option Explicit Private Const EncoderQuality As String = "{1D5BE4B5-FA4A-452D-9CDD-5DB35105E7EB ...
- 27.Hibernate-缓存和懒加载.md
目录 1.一级缓存 2.缓存的有效性 3.list和iterator缓存的区别 4.懒加载 4.1get 4.2load 1.一级缓存 Hibernate中一级缓存是Session缓存,有效范围在Se ...
- java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider
今天部署完一个测试war包,打开页面的时候报错: HTTP Status 500 - Handler processing failed; nested exception is java.lang. ...
- Linux Oracle安装
lsnrctl status // 查看linux系统oracle的监听状态lsnrctl start // 启动linux系统oracle的监听状态 sqlplus /nolog // 连接 ...
- 即时通信 选择UDP还是TCP协议
之前做过局域网的聊天软件,现在要做运行在广域网的聊天软件.开始接触网络编程,首先是接触到TCP和UDP协议 在网上查资料,都是这样描述 TCP面向连接,可靠,数据流 .UDP无连接,不可靠,数据报.但 ...
- Communication Model
[Communication Model] EOSIO actions operate primarily in a message-based communication architecture. ...
- 452. Minimum Number of Arrows to Burst Balloons扎气球的个数最少
[抄题]: There are a number of spherical balloons spread in two-dimensional space. For each balloon, pr ...
- pythone函数基础(8)内置函数学习
内置函数学习# sorted# map# filter# max# sum# round# chr# ord# dir# bool# eval# exec# zipimport mathres = m ...
- JavaSE基础知识(1)—初识Java
一.JAVA的背景 JAVA本身隶属的公司的是sun公司(创始公司) JAVA创始人:詹姆斯 高斯林 09年被oracle收购 JAVA的前身是Oak 二.JAVA的版本 95年 JAVA诞生96年 ...
- 校验金额、大小写字母、大写字母、合法uri、email
/* 合法uri*/ export function validURL(url) { const reg = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0- ...