Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is difference between these bootstrapping methods in angularJs?

Tags:

angularjs

Could not find the difference between these two.
Does this make sense to keep any of these to bootstrap my angular app?

angular.bootstrap(document,['myApp']);

or

angularAMD.bootstrap(app);
like image 912
ngLover Avatar asked Nov 09 '22 10:11

ngLover


1 Answers

angularAMD is an utility that facilitates the use of RequireJS in AngularJS applications supporting on-demand loading of 3rd party modules such as angular-ui.

And this module provides you

define(['angularAMD'], function (angularAMD) {
    var app = angular.module(app_name, ['webapp']);
    ... // Setup app here. E.g.: run .config with $routeProvider
    return angularAMD.bootstrap(app);
});

Where as angular.bootstrap(document,['myApp']); link is in build angular method to boostrap application.

Use any of it but stick with one only.

like image 101
squiroid Avatar answered Nov 15 '22 04:11

squiroid