brandonkboswell / AngularBooter

A Simple Booter For Multipage Angular Sites.
51 stars 12 forks source link

Modules with AngularBooter #4

Closed cchacholiades closed 9 years ago

cchacholiades commented 9 years ago

I am trying to use AngularStrap with AngularBooter. This requires to inject a module into the application, like so:

var app = angular.module('myApp', ['$strap.directives']);

How can I make use of AngularStrap with AngularBooter? Can I achieve this by registering a configuration?

myApp.config.push([function() { console.log('config 2'); }]);

brandonkboswell commented 9 years ago

Pretty close, if you need to have the AngularStrap dependency just push it into the dependencies array.

myApp = new AngularBooter('myApp');
myApp.dependencies.push('$strap.directives');

You can do this anytime prior to calling

myApp.boot();
cchacholiades commented 9 years ago

I've done this as suggested but I get an error:

Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.3.14/$injector/modulerr?p0=myApp&p1=Error%3A%…20at%20d%20(http%3A%2F%2Flocalhost%3A8000%2Fjs%2Fangular.min.js%3A17%3A381)

This is how my scripts structure looks like:

    <script src="//cdnjs.cloudflare.com/ajax/libs/angular-strap/2.1.2/angular-strap.min.js"></script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/angular-strap/2.1.2/angular-strap.tpl.min.js"></script>
    <script>
        window.myApp = new AngularBooter('myApp');
        myApp.dependencies.push('$strap.directives');
    </script>

And at the bottom of the document:

    <script>
        myApp.boot();
    </script>
cchacholiades commented 9 years ago

Nevermind, I changed it:

myApp.dependencies.push('mgcrea.ngStrap');

And seems to be work now. Thanks for your replies.