ded/script.js

AngularJS breaking when using $script

Closed this issue · 3 comments

I tried a few different methods to get angular working with $script, but the only way I could get it to work was to do normal <script> tag to load it.

I get the following errors when trying to use $script.

Uncaught TypeError: Object #<Object> has no method 'controller' controllers.js:2
Error: Argument 'AppController' is not a function, got undefined

I've also included my code in the below plunkr:
http://plnkr.co/edit/U6sUltGOU8IFsrzMAFay?p=preview

Discovered the issue, it was the loader.js script that is suppose to be used with $script. Unfortunately it was out of date from the example I got from the Angular-seed app.

I will create an issue on the Angular-seeed GitHub to update their example using their latest version of the loader, hope this helps someone!

Update: Link to angular-seed issue, solution included.

ded commented

haha. right on. so false alarm :)