简体   繁体   中英

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. 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.

Below is the Plunker where I am testing my code.

https://embed.plnkr.co/2blgWkwg0Se2SlLmuBrA/

Any help at all would be awesome!

You define your 'popUp' module correctly here:

angular.module('popUp',['ui.bootstrap']);

But you nevere include the 'popUp' module in your main application module ('myApp'). 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM