Is the following a roughly correct description of how Angular 1.x works?
AngularJS places an object angular
on the global object.
This angular instance can be configured using syntax like:
angular.module('my-module', []).directive('myDirective', myDirective);
An angular application can be created using angular.bootstrap
to create "application 1":
angular.bootstrap(domNode, ['my-module']);
If I then re-configure the angular
object:
angular.module('my-module').directive('myDirective', myDirective2);
...then "application 1" will not see this configuration change.
But if I use bootstrap
a second time (on another DOM node) to create "application 2":
angular.bootstrap(domNode2, ['my-module']);
...then "application 2" will see the change (and will not see the original myDirective
), and "application 1" will remain unaffected.