0

I'm trying to follow this tutorial here: http://www.mattburkedev.com/multiple-angular-versions-on-the-same-page/

It works until I inject my widget into a page that already has includes AngularJS and is using ng-app somewhere in the page. Both my version, and the existing version see the 'ng-app' and try to bootstrap it. The result is an error like:

Uncaught Error: [ng:btstrpd] App Already Bootstrapped with this Element '<div ng-app="myApp" class="ng-scope" ng-controller="IndexController">'

So my question is, is it possible to load in my version of Angular I need for my widget, and then tell it to not try and bootstrap anything automatically. I am handling it via: angular.bootstrap(angular.element(appDiv), ['myWidget']);

Corey
  • 351
  • 1
  • 2
  • 14

1 Answers1

0

In documentation is written:

only one AngularJS application can be auto-bootstrapped per HTML document. The first ngApp found in the document will be used to define the root element to auto-bootstrap as an application. To run multiple applications in an HTML document you must manually bootstrap them using angular.bootstrap instead.

So, it is possible, but you didn't provide any code.

Here is the example of two applications on one page.

Community
  • 1
  • 1
DicBrus
  • 1,291
  • 9
  • 9
  • That doesn't answer my question. My question is whether or not I can load AngularJS WITHOUT it bootstrapping any ngApps found. That way I can load 2 versions of angular, without them both attempting to bootstrap the app and then blowing up. – Corey Mar 09 '16 at 15:13