[英]angular.js:13550 Error: [ng:areq] Argument 'popCntrl' is not a function, got undefined
I am teaching myself AngularJS and I am trying to get a simple popup to open. 我正在自学AngularJS,并尝试打开一个简单的弹出窗口。 But I keep getting the error in the title above.
但是我一直在上面的标题中得到错误。 I have looked at other peoples examples of this error and none have seem to match my use case.
我看过其他人关于此错误的示例,但似乎没有一个与我的用例匹配。
Things I have tried: -checked capitalization 我尝试过的事情:-检查大小写
Other than that I am not 100% sure where I am going wrong. 除此之外,我不是100%知道我要去哪里错了。
Below is the Plunker where I am testing my code. 下面是我正在测试代码的Plunker。
https://embed.plnkr.co/2blgWkwg0Se2SlLmuBrA/ https://embed.plnkr.co/2blgWkwg0Se2SlLmuBrA/
Any help at all would be awesome! 根本没有任何帮助!
You define your 'popUp' module correctly here: 您可以在此处正确定义“ popUp”模块:
angular.module('popUp',['ui.bootstrap']);
But you nevere include the 'popUp' module in your main application module ('myApp'). 但是,您永远不要在主应用程序模块('myApp')中包含“ popUp”模块。 Simply add it to the list of dependencies:
只需将其添加到依赖项列表中:
var myApp = angular.module("myApp", ['ui.router', 'popUp']);
Here is an updated plunkr with a working modal. 这是一个带有工作模式的更新的punkr 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.