[Answer]-Angular JS bootstrapping app

1đź‘Ť

Generally speaking, when Angular throws a “no module” error, it means that there is an error in that module. It has nothing to do with the order they’re loaded. I’d run a jsLint on the file and see if it compiles.

Do you need to bootstrap manually? If you’re only loading one app you can attach an ng-app directive to any HTML element. I’m not sure you can use the try-catch like that with bootstrapping. What I do is something like this:

$.when(angular.bootstrap(document.getElementById('my-div'), ['my-app']))
    .done(function() {
        console.log("my-app has been bootstrapped to my-div");
    });
👤Sharondio

Leave a comment