requirejs-angular-loader icon indicating copy to clipboard operation
requirejs-angular-loader copied to clipboard

not work Appended Routes

Open Avtonom opened this issue 11 years ago • 3 comments

it seems to me that the line "ng.bootstrap(root, [name]);" breaks controller.

https://github.com/angular-ui/ui-router/issues/1172#issuecomment-48275219

Avtonom avatar Jul 08 '14 06:07 Avtonom

This is just manually app's bootstrap and it probably can not break controller.

Also you can try other way to boot app:

define(function(require) {
  require('modules/foo/foo-includes');
  require('modules/bar/bar-includes');
  require('modules/application/application-includes');

  var ng = require('angular');

  ng.module('my-app', [
    'application',
    'foo',
    'bar'
  ]);

 angular.resumeBootstrap();
});
<div ng-app="my-app"></div>

And add at the init script window.name = "NG_DEFER_BOOTSTRAP!";. You can read about this here.

tuchk4 avatar Jul 08 '14 09:07 tuchk4

Thanks for trying to help! Uncaught TypeError: undefined is not a function

 angular.resumeBootstrap();
 ng.resumeBootstrap();

Avtonom avatar Jul 11 '14 11:07 Avtonom

You should set window.name = "NG_DEFER_BOOTSTRAP!";. As I wrote before more details here - https://docs.angularjs.org/guide/bootstrap#deferred-bootstrap

tuchk4 avatar Jul 11 '14 12:07 tuchk4