为什么AngularJS会抛出错误的扩充错误

时间:2016-04-05 16:53:27

标签: javascript angularjs

当我将src链接中的角度scr代码文件从1.2.2更改为1.5.0时,我一直收到错误,即代码在1.2.2下工作完全正常,但如果我将其更改为1.5.0,则会出现此错误。我想将它更新为1.5.0我能做什么我的意思是代码中需要进行哪些更新以使其与angular 1.5.0兼容

        Error: ng:areq
        Bad Argument
        Argument 'Controller_index' is not a function, got undefined
        Description
        AngularJS often asserts that certain values will be present and truthy using a helper function. If the assertion fails, this error is thrown. To fix this problem, make sure that the value the assertion expects is defined and truthy. I know 1.2.2 is outdated but I am using the same thing and I don't know whats new in 1.5.0 and how to change it.As per my knowledge it looks fine to me. 

1 个答案:

答案 0 :(得分:1)

该错误表示您尚未将Controller_index注册为控制器。尝试添加:

module.controller('Controller_index', Controller_index);

这是breaking change between 1.2 and 1.3