@angular-wave/angular.ts 0.0.63 → 0.0.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/Makefile +6 -2
  2. package/dist/angular-ts.esm.js +2 -2
  3. package/dist/angular-ts.umd.js +2 -2
  4. package/package.json +1 -1
  5. package/src/angular.spec.js +13 -18
  6. package/src/animations/module.js +2 -2
  7. package/src/binding.spec.js +6 -3
  8. package/src/core/animate/animate.spec.js +1 -3
  9. package/src/core/cache/cache-factory.spec.js +2 -2
  10. package/src/core/compile/compile.spec.js +64 -57
  11. package/src/core/controller/controller.spec.js +2 -2
  12. package/src/core/cookie-reader.spec.js +2 -2
  13. package/src/core/filter/filter.spec.js +4 -4
  14. package/src/core/interpolate/interpolate.spec.js +2 -2
  15. package/src/core/interval/interval.spec.js +10 -7
  16. package/src/core/location/location.spec.js +2 -2
  17. package/src/core/ng-module.js +167 -0
  18. package/src/core/on.spec.js +2 -2
  19. package/src/core/parser/lexer.spec.js +11 -8
  20. package/src/core/parser/parse.spec.js +11 -8
  21. package/src/core/prop.spec.js +47 -35
  22. package/src/core/q/q.spec.js +6 -6
  23. package/src/core/root-element.spec.js +0 -2
  24. package/src/core/sce/sce.spec.js +7 -6
  25. package/src/core/scope/scope.spec.js +11 -8
  26. package/src/core/timeout/timeout.spec.js +10 -7
  27. package/src/directive/attrs/attrs.spec.js +4 -3
  28. package/src/directive/attrs/boolean.spec.js +2 -2
  29. package/src/directive/attrs/element-style.spec.js +4 -3
  30. package/src/directive/attrs/src.spec.js +7 -5
  31. package/src/directive/bind/bind.spec.js +10 -7
  32. package/src/directive/bind/bing-html.spec.js +2 -2
  33. package/src/directive/change/change.spec.js +2 -2
  34. package/src/directive/class/class.spec.js +2 -2
  35. package/src/directive/cloak/cloak.spec.js +2 -2
  36. package/src/directive/controller/controller.spec.js +2 -3
  37. package/src/directive/events/click.spec.js +2 -2
  38. package/src/directive/events/event.spec.js +16 -13
  39. package/src/directive/form/form.spec.js +11 -9
  40. package/src/directive/if/if.spec.js +2 -3
  41. package/src/directive/include/include.spec.js +11 -10
  42. package/src/directive/init/init.spec.js +2 -3
  43. package/src/directive/input/input.spec.js +10 -7
  44. package/src/directive/list/list.spec.js +2 -2
  45. package/src/directive/model/model.spec.js +11 -11
  46. package/src/directive/model-options/model-options.spec.js +11 -9
  47. package/src/directive/non-bindable/non-bindable.spec.js +10 -7
  48. package/src/directive/options/options.spec.js +10 -7
  49. package/src/directive/ref/href.spec.js +11 -8
  50. package/src/directive/ref/ref.spec.js +10 -7
  51. package/src/directive/repeat/repeat.spec.js +11 -10
  52. package/src/directive/script/script.spec.js +4 -3
  53. package/src/directive/select/select.spec.js +10 -7
  54. package/src/directive/show-hide/show-hide.spec.js +4 -3
  55. package/src/directive/style/style.spec.js +9 -6
  56. package/src/directive/switch/switch.spec.js +2 -2
  57. package/src/directive/validators/validators.spec.js +12 -9
  58. package/src/exts/aria/aria.js +2 -2
  59. package/src/exts/aria/aria.spec.js +2 -2
  60. package/src/exts/messages/messages.js +2 -2
  61. package/src/exts/messages/messages.spec.js +2 -2
  62. package/src/filters/filter.spec.js +4 -3
  63. package/src/filters/filters.spec.js +4 -3
  64. package/src/filters/limit-to.spec.js +4 -3
  65. package/src/filters/order-by.spec.js +7 -5
  66. package/src/index.js +2 -8
  67. package/src/injector.spec.js +26 -29
  68. package/src/loader.js +106 -538
  69. package/src/loader.md +142 -0
  70. package/src/loader.spec.js +5 -9
  71. package/src/public.js +113 -107
  72. package/src/public.spec.js +2 -4
  73. package/src/router/directives/state-directives.spec.js +0 -3
  74. package/src/router/directives/view-directive.spec.js +0 -6
  75. package/src/router/index.js +2 -2
  76. package/src/router/services.spec.js +0 -2
  77. package/src/router/state/state.spec.js +2 -4
  78. package/src/router/state-filter.spec.js +0 -2
  79. package/src/router/template-factory.spec.js +0 -2
  80. package/src/router/url/url-service.spec.js +0 -2
  81. package/src/router/view/view.spec.js +1 -2
  82. package/src/router/view-hook.spec.js +0 -2
  83. package/src/router/view-scroll.spec.js +0 -3
  84. package/src/services/http/http.spec.js +2 -2
  85. package/src/services/http/template-request.spec.js +3 -3
  86. package/src/services/http-backend/http-backend.spec.js +3 -2
  87. package/src/shared/jqlite/jqlite.spec.js +3 -4
  88. package/src/shared/test-utils.js +1 -1
  89. package/types/animations/module.d.ts +1 -1
  90. package/types/core/ng-module.d.ts +57 -0
  91. package/types/exts/aria/aria.d.ts +1 -1
  92. package/types/exts/messages/messages.d.ts +1 -1
  93. package/types/index.d.ts +0 -3
  94. package/types/loader.d.ts +53 -179
  95. package/types/public.d.ts +6 -1
  96. package/types/router/index.d.ts +1 -1
  97. package/types/shared/test-utils.d.ts +3 -2
package/src/loader.md CHANGED
@@ -11,3 +11,145 @@
11
11
  - lists a high level breakdown of each of the services/factories, filters, directives and testing
12
12
  - components available within this core module.
13
13
  - \*/
14
+
15
+ /\*\*
16
+
17
+ - @ngdoc directive
18
+ - @name ngApp
19
+ -
20
+ - @element ANY
21
+ - @param {import('./types').Module} ngApp an optional application
22
+ - {@link angular.module module} name to load.
23
+ - @param {boolean=} ngStrictDi if this attribute is present on the app element, the injector will be
24
+ - created in "strict-di" mode. This means that the application will fail to invoke functions which
25
+ - do not use explicit function annotation (and are thus unsuitable for minification), as described
26
+ - in {@link guide/di the Dependency Injection guide}, and useful debugging info will assist in
27
+ - tracking down the root of these bugs.
28
+ -
29
+ - @description
30
+ -
31
+ - Use this directive to **auto-bootstrap** an AngularJS application. The `ngApp` directive
32
+ - designates the **root element** of the application and is typically placed near the root element
33
+ - of the page - e.g. on the `<body>` or `<html>` tags.
34
+ -
35
+ - There are a few things to keep in mind when using `ngApp`:
36
+ - - only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp`
37
+ - found in the document will be used to define the root element to auto-bootstrap as an
38
+ - application. To run multiple applications in an HTML document you must manually bootstrap them using
39
+ - {@link angular.bootstrap} instead.
40
+ - - AngularJS applications cannot be nested within each other.
41
+ - - Do not use a directive that uses {@link ng.$compile#transclusion transclusion} on the same element as `ngApp`.
42
+ - This includes directives such as {@link ng.ngIf `ngIf`}, {@link ng.ngInclude `ngInclude`} and
43
+ - {@link ngRoute.ngView `ngView`}.
44
+ - Doing this misplaces the app {@link ng.$rootElement `$rootElement`} and the app's {@link auto.$injector injector},
45
+ - causing animations to stop working and making the injector inaccessible from outside the app.
46
+ -
47
+ - You can specify an **AngularJS module** to be used as the root module for the application. This
48
+ - module will be loaded into the {@link auto.$injector} when the application is bootstrapped. It
49
+ - should contain the application code needed or have dependencies on other modules that will
50
+ - contain the code. See {@link angular.module} for more information.
51
+ -
52
+ - In the example below if the `ngApp` directive were not placed on the `html` element then the
53
+ - document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}`
54
+ - would not be resolved to `3`.
55
+ -
56
+ - @example
57
+ -
58
+ - ### Simple Usage
59
+ -
60
+ - `ngApp` is the easiest, and most common way to bootstrap an application.
61
+ - <example module="ngAppDemo" name="ng-app">
62
+ <file name="index.html">
63
+ <div ng-controller="ngAppDemoController">
64
+ I can add: {{a}} + {{b}} = {{ a+b }}
65
+ </div>
66
+ </file>
67
+ <file name="script.js">
68
+ angular.module('ngAppDemo', []).controller('ngAppDemoController', function($scope) {
69
+ $scope.a = 1;
70
+ $scope.b = 2;
71
+ });
72
+ </file>
73
+ </example>
74
+ -
75
+ - @example
76
+ -
77
+ - ### With `ngStrictDi`
78
+ -
79
+ - Using `ngStrictDi`, you would see something like this:
80
+ - <example ng-app-included="true" name="strict-di">
81
+ <file name="index.html">
82
+ <div ng-app="ngAppStrictDemo" ng-strict-di>
83
+ <div ng-controller="GoodController1">
84
+ I can add: {{a}} + {{b}} = {{ a+b }}
85
+
86
+ <p>This renders because the controller does not fail to
87
+ instantiate, by using explicit annotation style (see
88
+ script.js for details)
89
+ </p>
90
+ </div>
91
+
92
+ <div ng-controller="GoodController2">
93
+ Name: <input ng-model="name"><br />
94
+ Hello, {{name}}!
95
+
96
+ <p>This renders because the controller does not fail to
97
+ instantiate, by using explicit annotation style
98
+ (see script.js for details)
99
+ </p>
100
+ </div>
101
+
102
+ <div ng-controller="BadController">
103
+ I can add: {{a}} + {{b}} = {{ a+b }}
104
+
105
+ <p>The controller could not be instantiated, due to relying
106
+ on automatic function annotations (which are disabled in
107
+ strict mode). As such, the content of this section is not
108
+ interpolated, and there should be an error in your web console.
109
+ </p>
110
+ </div>
111
+
112
+ </div>
113
+ </file>
114
+ <file name="script.js">
115
+ angular.module('ngAppStrictDemo', [])
116
+ // BadController will fail to instantiate, due to relying on automatic function annotation,
117
+ // rather than an explicit annotation
118
+ .controller('BadController', function($scope) {
119
+ $scope.a = 1;
120
+ $scope.b = 2;
121
+ })
122
+ // Unlike BadController, GoodController1 and GoodController2 will not fail to be instantiated,
123
+ // due to using explicit annotations using the array style and $inject property, respectively.
124
+ .controller('GoodController1', ['$scope', function($scope) {
125
+ $scope.a = 1;
126
+ $scope.b = 2;
127
+ }])
128
+ .controller('GoodController2', GoodController2);
129
+ function GoodController2($scope) {
130
+ $scope.name = 'World';
131
+ }
132
+ GoodController2.$inject = ['$scope'];
133
+ </file>
134
+ <file name="style.css">
135
+ div[ng-controller] {
136
+ margin-bottom: 1em;
137
+ -webkit-border-radius: 4px;
138
+ border-radius: 4px;
139
+ border: 1px solid;
140
+ padding: .5em;
141
+ }
142
+ div[ng-controller^=Good] {
143
+ border-color: #d6e9c6;
144
+ background-color: #dff0d8;
145
+ color: #3c763d;
146
+ }
147
+ div[ng-controller^=Bad] {
148
+ border-color: #ebccd1;
149
+ background-color: #f2dede;
150
+ color: #a94442;
151
+ margin-bottom: 0;
152
+ }
153
+ </file>
154
+ </example>
155
+ */
@@ -1,10 +1,11 @@
1
- import { setupModuleLoader } from "./loader";
1
+ import { Angular } from "./loader";
2
2
  import { createInjector } from "./injector";
3
3
 
4
4
  describe("module loader", () => {
5
+ var angular;
5
6
  beforeEach(() => {
6
7
  delete window.angular;
7
- setupModuleLoader(window);
8
+ angular = window.angular = new Angular();
8
9
  });
9
10
 
10
11
  it("should set up namespace", () => {
@@ -16,8 +17,7 @@ describe("module loader", () => {
16
17
  const { angular } = window;
17
18
  const { module } = angular;
18
19
 
19
- setupModuleLoader(window);
20
- setupModuleLoader(window);
20
+ window.angular = new Angular();
21
21
  expect(angular).toBe(angular);
22
22
  expect(angular.module).toBe(module);
23
23
  });
@@ -37,7 +37,7 @@ describe("module loader", () => {
37
37
 
38
38
  it("throws when trying to get a nonexistent module", () => {
39
39
  expect(() => {
40
- angular.module("myModule");
40
+ angular.module("nonexistent");
41
41
  }).toThrow();
42
42
  });
43
43
 
@@ -182,10 +182,6 @@ describe("module loader", () => {
182
182
  }).toThrow();
183
183
  });
184
184
 
185
- it("should expose `$$minErr` on the `angular` object", () => {
186
- expect(angular.$$minErr).toEqual(jasmine.any(Function));
187
- });
188
-
189
185
  describe("Module", () => {
190
186
  describe("info()", () => {
191
187
  let theModule;
package/src/public.js CHANGED
@@ -93,122 +93,128 @@ import { $$TaskTrackerFactoryProvider } from "./core/task-tracker-factory";
93
93
  import { TemplateRequestProvider } from "./services/template-request";
94
94
  import { $TimeoutProvider } from "./core/timeout/timeout";
95
95
  import { SanitizeUriProvider } from "./core/sanitize/sanitize-uri";
96
- import { setupModuleLoader } from "./loader";
97
96
  import { initAnimateModule } from "./animations/module";
98
97
  import { initMessageModule } from "./exts/messages/messages";
99
98
  import { initAriaModule } from "./exts/aria/aria";
100
99
  import { initRouter } from "./router/index";
101
- import { VERSION } from "./loader";
100
+
101
+ /**
102
+ * @type {string} `version` from `package.json`, injected by Rollup plugin
103
+ */
104
+ export const VERSION = "[VI]{version}[/VI]";
102
105
 
103
106
  /**
104
107
  * Initializes `ng`, `animate`, `message`, `aria` and `router` modules.
108
+ * @param {import('./loader').Angular} angular
105
109
  * @returns {import('./types').Module} `ng`module
106
110
  */
107
- export function publishExternalAPI() {
108
- const module = setupModuleLoader(window);
109
- const ng = module(
110
- "ng",
111
- [],
112
- [
113
- "$provide",
114
- function ngModule($provide) {
115
- // $$sanitizeUriProvider needs to be before $compileProvider as it is used by it.
116
- $provide.provider({
117
- $$sanitizeUri: SanitizeUriProvider,
118
- });
119
- $provide
120
- .provider("$compile", $CompileProvider)
121
- .directive({
122
- input: inputDirective,
123
- textarea: inputDirective,
124
- form: formDirective,
125
- script: scriptDirective,
126
- select: selectDirective,
127
- option: optionDirective,
128
- ngBind: ngBindDirective,
129
- ngBindHtml: ngBindHtmlDirective,
130
- ngBindTemplate: ngBindTemplateDirective,
131
- ngClass: ngClassDirective,
132
- ngClassEven: ngClassEvenDirective,
133
- ngClassOdd: ngClassOddDirective,
134
- ngCloak: ngCloakDirective,
135
- ngController: ngControllerDirective,
136
- ngForm: ngFormDirective,
137
- ngHide: ngHideDirective,
138
- ngIf: ngIfDirective,
139
- ngInclude: ngIncludeDirective,
140
- ngInit: ngInitDirective,
141
- ngNonBindable: ngNonBindableDirective,
142
- ngRef: ngRefDirective,
143
- ngRepeat: ngRepeatDirective,
144
- ngShow: ngShowDirective,
145
- ngStyle: ngStyleDirective,
146
- ngSwitch: ngSwitchDirective,
147
- ngSwitchWhen: ngSwitchWhenDirective,
148
- ngSwitchDefault: ngSwitchDefaultDirective,
149
- ngOptions: ngOptionsDirective,
150
- ngTransclude: ngTranscludeDirective,
151
- ngModel: ngModelDirective,
152
- ngList: ngListDirective,
153
- ngChange: ngChangeDirective,
154
- pattern: patternDirective,
155
- ngPattern: patternDirective,
156
- required: requiredDirective,
157
- ngRequired: requiredDirective,
158
- ngMinlength: minlengthDirective,
159
- minlength: minlengthDirective,
160
- ngMaxlength: maxlengthDirective,
161
- maxlength: maxlengthDirective,
162
- ngValue: ngValueDirective,
163
- ngModelOptions: ngModelOptionsDirective,
164
- })
165
- .directive({
166
- ngInclude: ngIncludeFillContentDirective,
167
- input: hiddenInputBrowserCacheDirective,
168
- })
169
- .directive(ngAttributeAliasDirectives)
170
- .directive(ngEventDirectives);
171
- $provide.provider({
172
- $anchorScroll: AnchorScrollProvider,
173
- $animate: AnimateProvider,
174
- $animateCss: CoreAnimateCssProvider,
175
- $$animateQueue: CoreAnimateQueueProvider,
176
- $$AnimateRunner: AnimateRunnerFactoryProvider,
177
- $$animateAsyncRun: AnimateAsyncRunFactoryProvider,
178
- $browser: BrowserProvider,
179
- $cacheFactory: CacheFactoryProvider,
180
- $controller: $ControllerProvider,
181
- $exceptionHandler: $ExceptionHandlerProvider,
182
- $filter: $FilterProvider,
183
- $interpolate: $InterpolateProvider,
184
- $interval: $IntervalProvider,
185
- $$intervalFactory: $$IntervalFactoryProvider,
186
- $http: $HttpProvider,
187
- $httpParamSerializer: $HttpParamSerializerProvider,
188
- $httpParamSerializerJQLike: $HttpParamSerializerJQLikeProvider,
189
- $httpBackend: $HttpBackendProvider,
190
- $xhrFactory: $xhrFactoryProvider,
191
- $location: $LocationProvider,
192
- $log: $LogProvider,
193
- $parse: $ParseProvider,
194
- $rootScope: $RootScopeProvider,
195
- $q: $QProvider,
196
- $$q: $$QProvider,
197
- $sce: $SceProvider,
198
- $sceDelegate: $SceDelegateProvider,
199
- $$taskTrackerFactory: $$TaskTrackerFactoryProvider,
200
- $templateCache: TemplateCacheProvider,
201
- $templateRequest: TemplateRequestProvider,
202
- $timeout: $TimeoutProvider,
203
- $$cookieReader: CookieReaderProvider,
204
- });
205
- },
206
- ],
207
- ).info({ angularVersion: VERSION });
111
+ export function publishExternalAPI(angular) {
112
+ console.assert(angular !== undefined, `angular is %s`, angular);
113
+ const ng = angular
114
+ .module(
115
+ "ng",
116
+ [],
117
+ [
118
+ "$provide",
119
+ ($provide) => {
120
+ // $$sanitizeUriProvider needs to be before $compileProvider as it is used by it.
121
+ $provide.provider({
122
+ $$sanitizeUri: SanitizeUriProvider,
123
+ });
124
+ $provide
125
+ .provider("$compile", $CompileProvider)
126
+ .directive({
127
+ input: inputDirective,
128
+ textarea: inputDirective,
129
+ form: formDirective,
130
+ script: scriptDirective,
131
+ select: selectDirective,
132
+ option: optionDirective,
133
+ ngBind: ngBindDirective,
134
+ ngBindHtml: ngBindHtmlDirective,
135
+ ngBindTemplate: ngBindTemplateDirective,
136
+ ngClass: ngClassDirective,
137
+ ngClassEven: ngClassEvenDirective,
138
+ ngClassOdd: ngClassOddDirective,
139
+ ngCloak: ngCloakDirective,
140
+ ngController: ngControllerDirective,
141
+ ngForm: ngFormDirective,
142
+ ngHide: ngHideDirective,
143
+ ngIf: ngIfDirective,
144
+ ngInclude: ngIncludeDirective,
145
+ ngInit: ngInitDirective,
146
+ ngNonBindable: ngNonBindableDirective,
147
+ ngRef: ngRefDirective,
148
+ ngRepeat: ngRepeatDirective,
149
+ ngShow: ngShowDirective,
150
+ ngStyle: ngStyleDirective,
151
+ ngSwitch: ngSwitchDirective,
152
+ ngSwitchWhen: ngSwitchWhenDirective,
153
+ ngSwitchDefault: ngSwitchDefaultDirective,
154
+ ngOptions: ngOptionsDirective,
155
+ ngTransclude: ngTranscludeDirective,
156
+ ngModel: ngModelDirective,
157
+ ngList: ngListDirective,
158
+ ngChange: ngChangeDirective,
159
+ pattern: patternDirective,
160
+ ngPattern: patternDirective,
161
+ required: requiredDirective,
162
+ ngRequired: requiredDirective,
163
+ ngMinlength: minlengthDirective,
164
+ minlength: minlengthDirective,
165
+ ngMaxlength: maxlengthDirective,
166
+ maxlength: maxlengthDirective,
167
+ ngValue: ngValueDirective,
168
+ ngModelOptions: ngModelOptionsDirective,
169
+ })
170
+ .directive({
171
+ ngInclude: ngIncludeFillContentDirective,
172
+ input: hiddenInputBrowserCacheDirective,
173
+ })
174
+ .directive(ngAttributeAliasDirectives)
175
+ .directive(ngEventDirectives);
176
+ $provide.provider({
177
+ $anchorScroll: AnchorScrollProvider,
178
+ $animate: AnimateProvider,
179
+ $animateCss: CoreAnimateCssProvider,
180
+ $$animateQueue: CoreAnimateQueueProvider,
181
+ $$AnimateRunner: AnimateRunnerFactoryProvider,
182
+ $$animateAsyncRun: AnimateAsyncRunFactoryProvider,
183
+ $browser: BrowserProvider,
184
+ $cacheFactory: CacheFactoryProvider,
185
+ $controller: $ControllerProvider,
186
+ $exceptionHandler: $ExceptionHandlerProvider,
187
+ $filter: $FilterProvider,
188
+ $interpolate: $InterpolateProvider,
189
+ $interval: $IntervalProvider,
190
+ $$intervalFactory: $$IntervalFactoryProvider,
191
+ $http: $HttpProvider,
192
+ $httpParamSerializer: $HttpParamSerializerProvider,
193
+ $httpParamSerializerJQLike: $HttpParamSerializerJQLikeProvider,
194
+ $httpBackend: $HttpBackendProvider,
195
+ $xhrFactory: $xhrFactoryProvider,
196
+ $location: $LocationProvider,
197
+ $log: $LogProvider,
198
+ $parse: $ParseProvider,
199
+ $rootScope: $RootScopeProvider,
200
+ $q: $QProvider,
201
+ $$q: $$QProvider,
202
+ $sce: $SceProvider,
203
+ $sceDelegate: $SceDelegateProvider,
204
+ $$taskTrackerFactory: $$TaskTrackerFactoryProvider,
205
+ $templateCache: TemplateCacheProvider,
206
+ $templateRequest: TemplateRequestProvider,
207
+ $timeout: $TimeoutProvider,
208
+ $$cookieReader: CookieReaderProvider,
209
+ });
210
+ },
211
+ ],
212
+ )
213
+ .info({ version: VERSION });
208
214
 
209
- initAnimateModule();
210
- initMessageModule();
211
- initAriaModule();
212
- initRouter();
215
+ initAnimateModule(angular);
216
+ initMessageModule(angular);
217
+ initAriaModule(angular);
218
+ initRouter(angular);
213
219
  return ng;
214
220
  }
@@ -1,9 +1,9 @@
1
- import { publishExternalAPI } from "./public";
2
1
  import { createInjector } from "./injector";
2
+ import { Angular } from "./loader";
3
3
 
4
4
  describe("public", () => {
5
5
  beforeEach(() => {
6
- publishExternalAPI();
6
+ window.angular = new Angular();
7
7
  });
8
8
 
9
9
  it("sets up the angular object and the module loader", () => {
@@ -21,13 +21,11 @@ describe("public", () => {
21
21
  });
22
22
 
23
23
  it("sets up the $parse service", () => {
24
- publishExternalAPI();
25
24
  const injector = createInjector(["ng"]);
26
25
  expect(injector.has("$parse")).toBe(true);
27
26
  });
28
27
 
29
28
  it("sets up the $rootScope", () => {
30
- publishExternalAPI();
31
29
  const injector = createInjector(["ng"]);
32
30
  expect(injector.has("$rootScope")).toBe(true);
33
31
  });
@@ -1,6 +1,5 @@
1
1
  import { JQLite } from "../../shared/jqlite/jqlite";
2
2
  import { Angular } from "../../loader";
3
- import { publishExternalAPI } from "../../public";
4
3
  import { browserTrigger, wait } from "../../shared/test-utils";
5
4
 
6
5
  describe("ngStateRef", () => {
@@ -21,7 +20,6 @@ describe("ngStateRef", () => {
21
20
  beforeEach(() => {
22
21
  window.location.hash = "";
23
22
  window.angular = new Angular();
24
- publishExternalAPI();
25
23
  let module = window.angular.module("defaultModule", ["ng.router"]);
26
24
  module.config(($stateProvider, $locationProvider) => {
27
25
  _locationProvider = $locationProvider;
@@ -726,7 +724,6 @@ describe("ngSrefActive", () => {
726
724
  beforeEach(() => {
727
725
  window.location.hash = "";
728
726
  window.angular = new Angular();
729
- publishExternalAPI();
730
727
  let module = window.angular.module("defaultModule", ["ng.router"]);
731
728
  module.config(function ($stateProvider) {
732
729
  _stateProvider = $stateProvider;
@@ -8,7 +8,6 @@
8
8
 
9
9
  import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
10
10
  import { Angular } from "../../loader";
11
- import { publishExternalAPI } from "../../public";
12
11
  import { wait } from "../../shared/test-utils";
13
12
 
14
13
  describe("ngView", () => {
@@ -136,7 +135,6 @@ describe("ngView", () => {
136
135
  beforeEach(() => {
137
136
  dealoc(document.getElementById("dummy"));
138
137
  window.angular = new Angular();
139
- publishExternalAPI();
140
138
  log = "";
141
139
  app = window.angular
142
140
  .module("defaultModule", ["ng.router"])
@@ -847,7 +845,6 @@ describe("UiView", () => {
847
845
  beforeEach(() => {
848
846
  dealoc(document.getElementById("dummy"));
849
847
  window.angular = new Angular();
850
- publishExternalAPI();
851
848
  log = "";
852
849
  app = window.angular
853
850
  .module("defaultModule", ["ng.router"])
@@ -927,7 +924,6 @@ describe("ngView transclusion", () => {
927
924
  beforeEach(() => {
928
925
  dealoc(document.getElementById("dummy"));
929
926
  window.angular = new Angular();
930
- publishExternalAPI();
931
927
  window.angular
932
928
  .module("defaultModule", ["ng.router"])
933
929
  .directive("scopeObserver", () => {
@@ -992,7 +988,6 @@ describe("ngView controllers or onEnter handlers", () => {
992
988
  beforeEach(() => {
993
989
  dealoc(document.getElementById("dummy"));
994
990
  window.angular = new Angular();
995
- publishExternalAPI();
996
991
  window.angular
997
992
  .module("defaultModule", ["ng.router"])
998
993
  .config(function ($stateProvider) {
@@ -1080,7 +1075,6 @@ describe("angular 1.5+ style .component()", () => {
1080
1075
  beforeEach(() => {
1081
1076
  dealoc(document.getElementById("dummy"));
1082
1077
  window.angular = new Angular();
1083
- publishExternalAPI();
1084
1078
  window.angular
1085
1079
  .module("defaultModule", ["ng.router"])
1086
1080
  .directive("ng12Directive", () => {
@@ -17,8 +17,8 @@ import { StateService } from "./state/state-service";
17
17
  import { UIRouterGlobals } from "./globals";
18
18
  import { TransitionService } from "./transition/transition-service";
19
19
 
20
- export function initRouter() {
21
- window["angular"]
20
+ export function initRouter(angular) {
21
+ angular
22
22
  .module("ng.router", ["ng"])
23
23
  .provider("$urlConfig", UrlConfigProvider)
24
24
  .provider("$routerGlobals", UIRouterGlobals)
@@ -1,5 +1,4 @@
1
1
  import { Angular } from "../loader";
2
- import { publishExternalAPI } from "../public";
3
2
 
4
3
  describe("router services", () => {
5
4
  let providers;
@@ -7,7 +6,6 @@ describe("router services", () => {
7
6
 
8
7
  beforeEach(() => {
9
8
  window["angular"] = new Angular();
10
- publishExternalAPI();
11
9
  let module = window["angular"].module("defaultModule", ["ng.router"]);
12
10
  module.config(
13
11
  (
@@ -1,6 +1,5 @@
1
- import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
1
+ import { dealoc } from "../../shared/jqlite/jqlite";
2
2
  import { Angular } from "../../loader";
3
- import { publishExternalAPI } from "../../public";
4
3
  import { isFunction } from "../../shared/utils";
5
4
  import { wait } from "../../shared/test-utils";
6
5
 
@@ -101,7 +100,7 @@ describe("$state", () => {
101
100
  dealoc(document.getElementById("dummy"));
102
101
  // some tests are polluting the cache
103
102
  window.angular = new Angular();
104
- publishExternalAPI();
103
+ window.angular = new Angular();
105
104
  module = window.angular.module("defaultModule", ["ng.router"]);
106
105
  module.config((_$stateProvider_, _$provide_) => {
107
106
  $stateProvider = _$stateProvider_;
@@ -144,7 +143,6 @@ describe("$state", () => {
144
143
  beforeEach(() => {
145
144
  dealoc(document.getElementById("dummy"));
146
145
  window.angular = new Angular();
147
- publishExternalAPI();
148
146
  module = window.angular.module("defaultModule", ["ng.router"]);
149
147
  module.config((_$stateProvider_, _$provide_) => {
150
148
  $stateProvider = _$stateProvider_;
@@ -1,5 +1,4 @@
1
1
  import { Angular } from "../loader";
2
- import { publishExternalAPI } from "../public";
3
2
 
4
3
  describe("router filters", function () {
5
4
  let module, $parse, $state, $q, $rootScope, $location;
@@ -7,7 +6,6 @@ describe("router filters", function () {
7
6
  beforeEach(() => {
8
7
  window.location.hash = "";
9
8
  window.angular = new Angular();
10
- publishExternalAPI();
11
9
  });
12
10
 
13
11
  afterEach(() => (window.location.hash = ""));
@@ -1,6 +1,5 @@
1
1
  import { dealoc, JQLite } from "../shared/jqlite/jqlite";
2
2
  import { Angular } from "../loader";
3
- import { publishExternalAPI } from "../public";
4
3
  import { wait } from "../shared/test-utils";
5
4
 
6
5
  describe("templateFactory", () => {
@@ -16,7 +15,6 @@ describe("templateFactory", () => {
16
15
  beforeEach(() => {
17
16
  dealoc(document.getElementById("dummy"));
18
17
  window.angular = new Angular();
19
- publishExternalAPI();
20
18
  window.angular.module("defaultModule", ["ng.router"]);
21
19
  $injector = window.angular.bootstrap(document.getElementById("dummy"), [
22
20
  "defaultModule",
@@ -1,6 +1,5 @@
1
1
  import { dealoc } from "../../shared/jqlite/jqlite";
2
2
  import { Angular } from "../../loader";
3
- import { publishExternalAPI } from "../../public";
4
3
  import { map, find } from "../../shared/common";
5
4
  import { forEach } from "../../shared/utils";
6
5
 
@@ -12,7 +11,6 @@ describe("UrlMatcher", () => {
12
11
  beforeEach(() => {
13
12
  dealoc(document.getElementById("dummy"));
14
13
  window.angular = new Angular();
15
- publishExternalAPI();
16
14
  window.angular.module("defaultModule", ["ng.router"]);
17
15
  $injector = window.angular.bootstrap(document.getElementById("dummy"), [
18
16
  "defaultModule",
@@ -1,6 +1,5 @@
1
1
  import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
2
2
  import { Angular } from "../../loader";
3
- import { publishExternalAPI } from "../../public";
4
3
  import { curry } from "../../shared/hof";
5
4
  import { StateMatcher } from "../../router/state/state-matcher";
6
5
  import { StateBuilder } from "../../router/state/state-builder";
@@ -29,7 +28,7 @@ describe("view", () => {
29
28
  beforeEach(() => {
30
29
  dealoc(document.getElementById("dummy"));
31
30
  window.angular = new Angular();
32
- publishExternalAPI();
31
+ window.angular = new Angular();
33
32
 
34
33
  window.angular
35
34
  .module("defaultModule", ["ng.router"])
@@ -1,6 +1,5 @@
1
1
  import { dealoc } from "../shared/jqlite/jqlite";
2
2
  import { Angular } from "../loader";
3
- import { publishExternalAPI } from "../public";
4
3
  import { wait } from "../shared/test-utils";
5
4
 
6
5
  describe("view hooks", () => {
@@ -23,7 +22,6 @@ describe("view hooks", () => {
23
22
  beforeEach(() => {
24
23
  dealoc(document.getElementById("dummy"));
25
24
  window.angular = new Angular();
26
- publishExternalAPI();
27
25
  app = window.angular
28
26
  .module("defaultModule", ["ng.router"])
29
27
  .config(($stateProvider) => {