angular js Error: [ng:areq]

小-文 2015-06-26 09:50:26
我原本的angularjs的版本是1.0,正常使用,更新版本到1.4后,报错
Error: [ng:areq] http://errors.angularjs.org/1.4.0-rc.1/ng/areq?p0=CallLogListCtrl&p1=not%20a%20function%2C%20got%20undefined
at Error (native)
at http://localhost:3000/javascripts/angular/angular-1.4.min.js:6:421
at Pb (http://localhost:3000/javascripts/angular/angular-1.4.min.js:21:41)
at Ma (http://localhost:3000/javascripts/angular/angular-1.4.min.js:21:128)
at http://localhost:3000/javascripts/angular/angular-1.4.min.js:78:173
at y (http://localhost:3000/javascripts/angular/angular-1.4.min.js:58:278)
at Z (http://localhost:3000/javascripts/angular/angular-1.4.min.js:59:114)
at g (http://localhost:3000/javascripts/angular/angular-1.4.min.js:53:298)
at g (http://localhost:3000/javascripts/angular/angular-1.4.min.js:53:321)
at http://localhost:3000/javascripts/angular/angular-1.4.min.js:52:330(anonymous function) @ angular-1.4.min.js:106


附上我的代码段
doctype html
html(lang='en', ng-app='calllogs')
head
meta(charset='utf-8')
meta(name='viewport', content='width=device-width,initial-scale=1, user-scalable=no')
title= title
link(rel='stylesheet', href='/javascripts/bootstrap/bootstrap.min.css')
link(rel='stylesheet', href='/stylesheets/style.css')
script(type="text/javascript", src="/javascripts/jquery-1.7.1.min.js")
script(type="text/javascript", src="/javascripts/bootstrap/bootstrap.min.js")
//script(type="text/javascript", src="/javascripts/angular/angular.min.js")
script(type="text/javascript", src="/javascripts/angular/angular-1.4.min.js")
script(type="text/javascript", src="/javascripts/angular/angular-resource.min.js")
script(type="text/javascript", src="/javascripts/angular/angular-route.min.js")
script(type="text/javascript", src="/javascripts/app.js")
script(type="text/javascript", src="/javascripts/controllers.js")



body(ng-controller='CallLogListCtrl')
nav.navbar.navbar-inverse.navbar-fixed-top(role='navigation')
div.navbar-header
a.navbar-brand(href='#/list')= title
div.container
div(ng-view)

app.js
angular.module("calllogs", ['ngRoute'])

.config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/list', { templateUrl: 'partials/list.html', controller:
CallLogListCtrl }).
when('/syslog', { templateUrl: 'partials/syslog.html', controller:
SysLogListCtrl }).
otherwise({ redirectTo: '/calllogs' });
}]);

controller.js
angular.module('calllogs', ['ngRoute']).controller('CallLogListCtrl',function ($scope, $http, $routeParams) {

//function CallLogListCtrl($scope, $http, $routeParams) {
...
})


求大神指点
...全文
6854 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
icond_ 2017-01-10
  • 打赏
  • 举报
回复
引入版本问题
xiejunna 2016-12-18
  • 打赏
  • 举报
回复
可以参考:http://blog.csdn.net/xiejunna/article/details/53727873 是controller没有同步定义
xiaopohou 2016-07-26
  • 打赏
  • 举报
回复
问题解决了吗,我也遇见这个问题了
Sophia_1122 2016-05-17
  • 打赏
  • 举报
回复
是版本的问题,换成1.2的应该就可以了
qq_30367759 2015-12-23
  • 打赏
  • 举报
回复
楼主这个问题解决了吗,我现在也遇到这个问
俢北 2015-07-02
  • 打赏
  • 举报
回复
moudle是唯一的不能重名,需要设置moudle依赖

87,901

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧