@angular/upgrade 19.2.1 → 19.2.2

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.
@@ -0,0 +1,334 @@
1
+ /**
2
+ * @license Angular v19.2.2
3
+ * (c) 2010-2025 Google LLC. https://angular.io/
4
+ * License: MIT
5
+ */
6
+
7
+ import { Version } from '@angular/core';
8
+
9
+ /**
10
+ * @module
11
+ * @description
12
+ * Entry point for all public APIs of the upgrade package.
13
+ */
14
+
15
+ /**
16
+ * @publicApi
17
+ */
18
+ declare const VERSION: Version;
19
+
20
+ type Ng1Token = string;
21
+ type Ng1Expression = string | Function;
22
+ interface IAnnotatedFunction extends Function {
23
+ $inject?: Function extends {
24
+ $inject?: string[];
25
+ } ? Ng1Token[] : ReadonlyArray<Ng1Token>;
26
+ }
27
+ type IInjectable = (Ng1Token | Function)[] | IAnnotatedFunction;
28
+ type SingleOrListOrMap<T> = T | T[] | {
29
+ [key: string]: T;
30
+ };
31
+ interface IModule {
32
+ name: string;
33
+ requires: (string | IInjectable)[];
34
+ config(fn: IInjectable): IModule;
35
+ directive(selector: string, factory: IInjectable): IModule;
36
+ component(selector: string, component: IComponent): IModule;
37
+ controller(name: string, type: IInjectable): IModule;
38
+ factory(key: Ng1Token, factoryFn: IInjectable): IModule;
39
+ value(key: Ng1Token, value: any): IModule;
40
+ constant(token: Ng1Token, value: any): IModule;
41
+ run(a: IInjectable): IModule;
42
+ }
43
+ interface ICompileService {
44
+ (element: Element | NodeList | Node[] | string, transclude?: Function): ILinkFn;
45
+ }
46
+ interface ILinkFn {
47
+ (scope: IScope, cloneAttachFn?: ICloneAttachFunction, options?: ILinkFnOptions): IAugmentedJQuery;
48
+ $$slots?: {
49
+ [slotName: string]: ILinkFn;
50
+ };
51
+ }
52
+ interface ILinkFnOptions {
53
+ parentBoundTranscludeFn?: Function;
54
+ transcludeControllers?: {
55
+ [key: string]: any;
56
+ };
57
+ futureParentElement?: Node;
58
+ }
59
+ interface IRootScopeService {
60
+ $new(isolate?: boolean): IScope;
61
+ $id: string;
62
+ $parent: IScope;
63
+ $root: IScope;
64
+ $watch(exp: Ng1Expression, fn?: (a1?: any, a2?: any) => void): Function;
65
+ $on(event: string, fn?: (event?: any, ...args: any[]) => void): Function;
66
+ $destroy(): any;
67
+ $apply(exp?: Ng1Expression): any;
68
+ $digest(): any;
69
+ $evalAsync(exp: Ng1Expression, locals?: any): void;
70
+ $on(event: string, fn?: (event?: any, ...args: any[]) => void): Function;
71
+ $$childTail: IScope;
72
+ $$childHead: IScope;
73
+ $$nextSibling: IScope;
74
+ $$phase: any;
75
+ [key: string]: any;
76
+ }
77
+ interface IScope extends IRootScopeService {
78
+ }
79
+ interface IAngularBootstrapConfig {
80
+ strictDi?: boolean;
81
+ }
82
+ interface IDirective {
83
+ compile?: IDirectiveCompileFn;
84
+ controller?: IController;
85
+ controllerAs?: string;
86
+ bindToController?: boolean | {
87
+ [key: string]: string;
88
+ };
89
+ link?: IDirectiveLinkFn | IDirectivePrePost;
90
+ name?: string;
91
+ priority?: number;
92
+ replace?: boolean;
93
+ require?: DirectiveRequireProperty;
94
+ restrict?: string;
95
+ scope?: boolean | {
96
+ [key: string]: string;
97
+ };
98
+ template?: string | Function;
99
+ templateUrl?: string | Function;
100
+ templateNamespace?: string;
101
+ terminal?: boolean;
102
+ transclude?: DirectiveTranscludeProperty;
103
+ }
104
+ type DirectiveRequireProperty = SingleOrListOrMap<string>;
105
+ type DirectiveTranscludeProperty = boolean | 'element' | {
106
+ [key: string]: string;
107
+ };
108
+ interface IDirectiveCompileFn {
109
+ (templateElement: IAugmentedJQuery, templateAttributes: IAttributes, transclude: ITranscludeFunction): IDirectivePrePost;
110
+ }
111
+ interface IDirectivePrePost {
112
+ pre?: IDirectiveLinkFn;
113
+ post?: IDirectiveLinkFn;
114
+ }
115
+ interface IDirectiveLinkFn {
116
+ (scope: IScope, instanceElement: IAugmentedJQuery, instanceAttributes: IAttributes, controller: any, transclude: ITranscludeFunction): void;
117
+ }
118
+ interface IComponent {
119
+ bindings?: {
120
+ [key: string]: string;
121
+ };
122
+ controller?: string | IInjectable;
123
+ controllerAs?: string;
124
+ require?: DirectiveRequireProperty;
125
+ template?: string | Function;
126
+ templateUrl?: string | Function;
127
+ transclude?: DirectiveTranscludeProperty;
128
+ }
129
+ interface IAttributes {
130
+ $observe(attr: string, fn: (v: string) => void): void;
131
+ [key: string]: any;
132
+ }
133
+ interface ITranscludeFunction {
134
+ (scope: IScope, cloneAttachFn: ICloneAttachFunction): IAugmentedJQuery;
135
+ (cloneAttachFn?: ICloneAttachFunction): IAugmentedJQuery;
136
+ }
137
+ interface ICloneAttachFunction {
138
+ (clonedElement: IAugmentedJQuery, scope: IScope): any;
139
+ }
140
+ type IAugmentedJQuery = Node[] & {
141
+ on?: (name: string, fn: () => void) => void;
142
+ data?: (name: string, value?: any) => any;
143
+ text?: () => string;
144
+ inheritedData?: (name: string, value?: any) => any;
145
+ children?: () => IAugmentedJQuery;
146
+ contents?: () => IAugmentedJQuery;
147
+ parent?: () => IAugmentedJQuery;
148
+ empty?: () => void;
149
+ append?: (content: IAugmentedJQuery | string) => IAugmentedJQuery;
150
+ controller?: (name: string) => any;
151
+ isolateScope?: () => IScope;
152
+ injector?: () => IInjectorService;
153
+ triggerHandler?: (eventTypeOrObject: string | Event, extraParameters?: any[]) => IAugmentedJQuery;
154
+ remove?: () => void;
155
+ removeData?: () => void;
156
+ };
157
+ interface IProvider {
158
+ $get: IInjectable;
159
+ }
160
+ interface IProvideService {
161
+ provider(token: Ng1Token, provider: IProvider): IProvider;
162
+ factory(token: Ng1Token, factory: IInjectable): IProvider;
163
+ service(token: Ng1Token, type: IInjectable): IProvider;
164
+ value(token: Ng1Token, value: any): IProvider;
165
+ constant(token: Ng1Token, value: any): void;
166
+ decorator(token: Ng1Token, factory: IInjectable): void;
167
+ }
168
+ interface IParseService {
169
+ (expression: string): ICompiledExpression;
170
+ }
171
+ interface ICompiledExpression {
172
+ (context: any, locals: any): any;
173
+ assign?: (context: any, value: any) => any;
174
+ }
175
+ interface IHttpBackendService {
176
+ (method: string, url: string, post?: any, callback?: Function, headers?: any, timeout?: number, withCredentials?: boolean): void;
177
+ }
178
+ interface ICacheObject {
179
+ put<T>(key: string, value?: T): T;
180
+ get(key: string): any;
181
+ }
182
+ interface ITemplateCacheService extends ICacheObject {
183
+ }
184
+ type IController = string | IInjectable;
185
+ interface IControllerService {
186
+ (controllerConstructor: IController, locals?: any, later?: any, ident?: any): any;
187
+ (controllerName: string, locals?: any): any;
188
+ }
189
+ interface IInjectorService {
190
+ get(key: string): any;
191
+ has(key: string): boolean;
192
+ }
193
+ interface IIntervalService {
194
+ (func: Function, delay: number, count?: number, invokeApply?: boolean, ...args: any[]): Promise<any>;
195
+ cancel(promise: Promise<any>): boolean;
196
+ }
197
+ interface ITestabilityService {
198
+ findBindings(element: Element, expression: string, opt_exactMatch?: boolean): Element[];
199
+ findModels(element: Element, expression: string, opt_exactMatch?: boolean): Element[];
200
+ getLocation(): string;
201
+ setLocation(url: string): void;
202
+ whenStable(callback: Function): void;
203
+ }
204
+ interface INgModelController {
205
+ $render(): void;
206
+ $isEmpty(value: any): boolean;
207
+ $setValidity(validationErrorKey: string, isValid: boolean): void;
208
+ $setPristine(): void;
209
+ $setDirty(): void;
210
+ $setUntouched(): void;
211
+ $setTouched(): void;
212
+ $rollbackViewValue(): void;
213
+ $validate(): void;
214
+ $commitViewValue(): void;
215
+ $setViewValue(value: any, trigger: string): void;
216
+ $viewValue: any;
217
+ $modelValue: any;
218
+ $parsers: Function[];
219
+ $formatters: Function[];
220
+ $validators: {
221
+ [key: string]: Function;
222
+ };
223
+ $asyncValidators: {
224
+ [key: string]: Function;
225
+ };
226
+ $viewChangeListeners: Function[];
227
+ $error: Object;
228
+ $pending: Object;
229
+ $untouched: boolean;
230
+ $touched: boolean;
231
+ $pristine: boolean;
232
+ $dirty: boolean;
233
+ $valid: boolean;
234
+ $invalid: boolean;
235
+ $name: string;
236
+ }
237
+ declare let angular: {
238
+ bootstrap: (e: Element, modules: (string | IInjectable)[], config?: IAngularBootstrapConfig) => IInjectorService;
239
+ module: (prefix: string, dependencies?: string[]) => IModule;
240
+ element: {
241
+ (e: string | Element | Document | IAugmentedJQuery): IAugmentedJQuery;
242
+ cleanData: (nodes: Node[] | NodeList) => void;
243
+ };
244
+ injector: (modules: Array<string | IInjectable>, strictDi?: boolean) => IInjectorService;
245
+ version: {
246
+ major: number;
247
+ };
248
+ resumeBootstrap: () => void;
249
+ getTestability: (e: Element) => ITestabilityService;
250
+ };
251
+ /**
252
+ * @deprecated Use `setAngularJSGlobal` instead.
253
+ *
254
+ * @publicApi
255
+ */
256
+ declare function setAngularLib(ng: any): void;
257
+ /**
258
+ * @deprecated Use `getAngularJSGlobal` instead.
259
+ *
260
+ * @publicApi
261
+ */
262
+ declare function getAngularLib(): any;
263
+ /**
264
+ * Resets the AngularJS global.
265
+ *
266
+ * Used when AngularJS is loaded lazily, and not available on `window`.
267
+ *
268
+ * @publicApi
269
+ */
270
+ declare function setAngularJSGlobal(ng: any): void;
271
+ /**
272
+ * Returns the current AngularJS global.
273
+ *
274
+ * @publicApi
275
+ */
276
+ declare function getAngularJSGlobal(): any;
277
+ declare const bootstrap: typeof angular.bootstrap;
278
+ declare const module_: typeof angular.module;
279
+ declare const element: typeof angular.element;
280
+ declare const injector: typeof angular.injector;
281
+ declare const resumeBootstrap: typeof angular.resumeBootstrap;
282
+ declare const getTestability: typeof angular.getTestability;
283
+
284
+ type angular1_d_DirectiveRequireProperty = DirectiveRequireProperty;
285
+ type angular1_d_DirectiveTranscludeProperty = DirectiveTranscludeProperty;
286
+ type angular1_d_IAngularBootstrapConfig = IAngularBootstrapConfig;
287
+ type angular1_d_IAnnotatedFunction = IAnnotatedFunction;
288
+ type angular1_d_IAttributes = IAttributes;
289
+ type angular1_d_IAugmentedJQuery = IAugmentedJQuery;
290
+ type angular1_d_ICacheObject = ICacheObject;
291
+ type angular1_d_ICloneAttachFunction = ICloneAttachFunction;
292
+ type angular1_d_ICompileService = ICompileService;
293
+ type angular1_d_ICompiledExpression = ICompiledExpression;
294
+ type angular1_d_IComponent = IComponent;
295
+ type angular1_d_IController = IController;
296
+ type angular1_d_IControllerService = IControllerService;
297
+ type angular1_d_IDirective = IDirective;
298
+ type angular1_d_IDirectiveCompileFn = IDirectiveCompileFn;
299
+ type angular1_d_IDirectiveLinkFn = IDirectiveLinkFn;
300
+ type angular1_d_IDirectivePrePost = IDirectivePrePost;
301
+ type angular1_d_IHttpBackendService = IHttpBackendService;
302
+ type angular1_d_IInjectable = IInjectable;
303
+ type angular1_d_IInjectorService = IInjectorService;
304
+ type angular1_d_IIntervalService = IIntervalService;
305
+ type angular1_d_ILinkFn = ILinkFn;
306
+ type angular1_d_ILinkFnOptions = ILinkFnOptions;
307
+ type angular1_d_IModule = IModule;
308
+ type angular1_d_INgModelController = INgModelController;
309
+ type angular1_d_IParseService = IParseService;
310
+ type angular1_d_IProvideService = IProvideService;
311
+ type angular1_d_IProvider = IProvider;
312
+ type angular1_d_IRootScopeService = IRootScopeService;
313
+ type angular1_d_IScope = IScope;
314
+ type angular1_d_ITemplateCacheService = ITemplateCacheService;
315
+ type angular1_d_ITestabilityService = ITestabilityService;
316
+ type angular1_d_ITranscludeFunction = ITranscludeFunction;
317
+ type angular1_d_Ng1Expression = Ng1Expression;
318
+ type angular1_d_Ng1Token = Ng1Token;
319
+ type angular1_d_SingleOrListOrMap<T> = SingleOrListOrMap<T>;
320
+ declare const angular1_d_bootstrap: typeof bootstrap;
321
+ declare const angular1_d_element: typeof element;
322
+ declare const angular1_d_getAngularJSGlobal: typeof getAngularJSGlobal;
323
+ declare const angular1_d_getAngularLib: typeof getAngularLib;
324
+ declare const angular1_d_getTestability: typeof getTestability;
325
+ declare const angular1_d_injector: typeof injector;
326
+ declare const angular1_d_module_: typeof module_;
327
+ declare const angular1_d_resumeBootstrap: typeof resumeBootstrap;
328
+ declare const angular1_d_setAngularJSGlobal: typeof setAngularJSGlobal;
329
+ declare const angular1_d_setAngularLib: typeof setAngularLib;
330
+ declare namespace angular1_d {
331
+ export { type angular1_d_DirectiveRequireProperty as DirectiveRequireProperty, type angular1_d_DirectiveTranscludeProperty as DirectiveTranscludeProperty, type angular1_d_IAngularBootstrapConfig as IAngularBootstrapConfig, type angular1_d_IAnnotatedFunction as IAnnotatedFunction, type angular1_d_IAttributes as IAttributes, type angular1_d_IAugmentedJQuery as IAugmentedJQuery, type angular1_d_ICacheObject as ICacheObject, type angular1_d_ICloneAttachFunction as ICloneAttachFunction, type angular1_d_ICompileService as ICompileService, type angular1_d_ICompiledExpression as ICompiledExpression, type angular1_d_IComponent as IComponent, type angular1_d_IController as IController, type angular1_d_IControllerService as IControllerService, type angular1_d_IDirective as IDirective, type angular1_d_IDirectiveCompileFn as IDirectiveCompileFn, type angular1_d_IDirectiveLinkFn as IDirectiveLinkFn, type angular1_d_IDirectivePrePost as IDirectivePrePost, type angular1_d_IHttpBackendService as IHttpBackendService, type angular1_d_IInjectable as IInjectable, type angular1_d_IInjectorService as IInjectorService, type angular1_d_IIntervalService as IIntervalService, type angular1_d_ILinkFn as ILinkFn, type angular1_d_ILinkFnOptions as ILinkFnOptions, type angular1_d_IModule as IModule, type angular1_d_INgModelController as INgModelController, type angular1_d_IParseService as IParseService, type angular1_d_IProvideService as IProvideService, type angular1_d_IProvider as IProvider, type angular1_d_IRootScopeService as IRootScopeService, type angular1_d_IScope as IScope, type angular1_d_ITemplateCacheService as ITemplateCacheService, type angular1_d_ITestabilityService as ITestabilityService, type angular1_d_ITranscludeFunction as ITranscludeFunction, type angular1_d_Ng1Expression as Ng1Expression, type angular1_d_Ng1Token as Ng1Token, type angular1_d_SingleOrListOrMap as SingleOrListOrMap, angular1_d_bootstrap as bootstrap, angular1_d_element as element, angular1_d_getAngularJSGlobal as getAngularJSGlobal, angular1_d_getAngularLib as getAngularLib, angular1_d_getTestability as getTestability, angular1_d_injector as injector, angular1_d_module_ as module_, angular1_d_resumeBootstrap as resumeBootstrap, angular1_d_setAngularJSGlobal as setAngularJSGlobal, angular1_d_setAngularLib as setAngularLib };
332
+ }
333
+
334
+ export { type IRootScopeService as I, type SingleOrListOrMap as S, VERSION as V, type IInjectorService as a, type IAngularBootstrapConfig as b, type IAugmentedJQuery as c, type IDirective as d, type IController as e, type IScope as f, type ILinkFn as g, type INgModelController as h, getAngularJSGlobal as i, getAngularLib as j, setAngularLib as k, angular1_d as l, setAngularJSGlobal as s };
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @license Angular v19.2.1
2
+ * @license Angular v19.2.2
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
7
  import * as i0 from '@angular/core';
8
8
  import { NgModule, Injector } from '@angular/core';
9
- import { ɵconstants, ɵangular1 } from '@angular/upgrade/static';
9
+ import { ɵangular1 as _angular1, ɵconstants as _constants } from '@angular/upgrade/static';
10
10
  import { TestBed } from '@angular/core/testing';
11
11
 
12
12
  let $injector = null;
@@ -18,13 +18,13 @@ class AngularTestingModule {
18
18
  constructor(i) {
19
19
  injector = i;
20
20
  }
21
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: AngularTestingModule, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.NgModule });
22
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.1", ngImport: i0, type: AngularTestingModule });
23
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: AngularTestingModule, providers: [{ provide: ɵconstants.$INJECTOR, useFactory: $injectorFactory }] });
21
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: AngularTestingModule, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.NgModule });
22
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.2", ngImport: i0, type: AngularTestingModule });
23
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: AngularTestingModule, providers: [{ provide: _constants.$INJECTOR, useFactory: $injectorFactory }] });
24
24
  }
25
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: AngularTestingModule, decorators: [{
25
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: AngularTestingModule, decorators: [{
26
26
  type: NgModule,
27
- args: [{ providers: [{ provide: ɵconstants.$INJECTOR, useFactory: $injectorFactory }] }]
27
+ args: [{ providers: [{ provide: _constants.$INJECTOR, useFactory: $injectorFactory }] }]
28
28
  }], ctorParameters: () => [{ type: i0.Injector }] });
29
29
  /**
30
30
  * A helper function to use when unit testing Angular services that depend upon upgraded AngularJS
@@ -92,11 +92,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
92
92
  * @publicApi
93
93
  */
94
94
  function createAngularTestingModule(angularJSModules, strictDi) {
95
- ɵangular1
95
+ _angular1
96
96
  .module_('$$angularJSTestingModule', angularJSModules)
97
- .constant(ɵconstants.UPGRADE_APP_TYPE_KEY, 2 /* UpgradeAppType.Static */)
98
- .factory(ɵconstants.INJECTOR_KEY, () => injector);
99
- $injector = ɵangular1.injector(['ng', '$$angularJSTestingModule'], strictDi);
97
+ .constant(_constants.UPGRADE_APP_TYPE_KEY, 2 /* UpgradeAppType.Static */)
98
+ .factory(_constants.INJECTOR_KEY, () => injector);
99
+ $injector = _angular1.injector(['ng', '$$angularJSTestingModule'], strictDi);
100
100
  return AngularTestingModule;
101
101
  }
102
102
 
@@ -166,24 +166,20 @@ function createAngularTestingModule(angularJSModules, strictDi) {
166
166
  * @publicApi
167
167
  */
168
168
  function createAngularJSTestingModule(angularModules) {
169
- return ɵangular1
169
+ return _angular1
170
170
  .module_('$$angularJSTestingModule', [])
171
- .constant(ɵconstants.UPGRADE_APP_TYPE_KEY, 2 /* UpgradeAppType.Static */)
172
- .factory(ɵconstants.INJECTOR_KEY, [
173
- ɵconstants.$INJECTOR,
171
+ .constant(_constants.UPGRADE_APP_TYPE_KEY, 2 /* UpgradeAppType.Static */)
172
+ .factory(_constants.INJECTOR_KEY, [
173
+ _constants.$INJECTOR,
174
174
  ($injector) => {
175
175
  TestBed.configureTestingModule({
176
176
  imports: angularModules,
177
- providers: [{ provide: ɵconstants.$INJECTOR, useValue: $injector }],
177
+ providers: [{ provide: _constants.$INJECTOR, useValue: $injector }],
178
178
  });
179
179
  return TestBed.inject(Injector);
180
180
  },
181
181
  ]).name;
182
182
  }
183
183
 
184
- /**
185
- * Generated bundle index. Do not edit.
186
- */
187
-
188
184
  export { createAngularJSTestingModule, createAngularTestingModule };
189
185
  //# sourceMappingURL=testing.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"testing.mjs","sources":["../../../../../../../packages/upgrade/static/testing/src/create_angular_testing_module.ts","../../../../../../../packages/upgrade/static/testing/src/create_angularjs_testing_module.ts","../../../../../../../packages/upgrade/static/testing/testing.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Injector, NgModule, Type} from '@angular/core';\nimport {ɵangular1 as angular, ɵconstants} from '@angular/upgrade/static';\n\nimport {UpgradeAppType} from '../../../src/common/src/util';\n\nlet $injector: angular.IInjectorService | null = null;\nlet injector: Injector;\n\nexport function $injectorFactory() {\n return $injector;\n}\n\n@NgModule({providers: [{provide: ɵconstants.$INJECTOR, useFactory: $injectorFactory}]})\nexport class AngularTestingModule {\n constructor(i: Injector) {\n injector = i;\n }\n}\n\n/**\n * A helper function to use when unit testing Angular services that depend upon upgraded AngularJS\n * services.\n *\n * This function returns an `NgModule` decorated class that is configured to wire up the Angular\n * and AngularJS injectors without the need to actually bootstrap a hybrid application.\n * This makes it simpler and faster to unit test services.\n *\n * Use the returned class as an \"import\" when configuring the `TestBed`.\n *\n * In the following code snippet, we are configuring the TestBed with two imports.\n * The `Ng2AppModule` is the Angular part of our hybrid application and the `ng1AppModule` is the\n * AngularJS part.\n *\n * {@example upgrade/static/ts/full/module.spec.ts region='angular-setup'}\n *\n * Once this is done we can get hold of services via the Angular `Injector` as normal.\n * Services that are (or have dependencies on) an upgraded AngularJS service, will be instantiated\n * as needed by the AngularJS `$injector`.\n *\n * In the following code snippet, `HeroesService` is an Angular service that depends upon an\n * AngularJS service, `titleCase`.\n *\n * {@example upgrade/static/ts/full/module.spec.ts region='angular-spec'}\n *\n * <div class=\"docs-alert docs-alert-important\">\n *\n * This helper is for testing services not Components.\n * For Component testing you must still bootstrap a hybrid app. See `UpgradeModule` or\n * `downgradeModule` for more information.\n *\n * </div>\n *\n * <div class=\"docs-alert docs-alert-important\">\n *\n * The resulting configuration does not wire up AngularJS digests to Zone hooks. It is the\n * responsibility of the test writer to call `$rootScope.$apply`, as necessary, to trigger\n * AngularJS handlers of async events from Angular.\n *\n * </div>\n *\n * <div class=\"docs-alert docs-alert-important\">\n *\n * The helper sets up global variables to hold the shared Angular and AngularJS injectors.\n *\n * * Only call this helper once per spec.\n * * Do not use `createAngularTestingModule` in the same spec as `createAngularJSTestingModule`.\n *\n * </div>\n *\n * Here is the example application and its unit tests that use `createAngularTestingModule`\n * and `createAngularJSTestingModule`.\n *\n * <code-tabs>\n * <code-pane header=\"module.spec.ts\" path=\"upgrade/static/ts/full/module.spec.ts\"></code-pane>\n * <code-pane header=\"module.ts\" path=\"upgrade/static/ts/full/module.ts\"></code-pane>\n * </code-tabs>\n *\n *\n * @param angularJSModules a collection of the names of AngularJS modules to include in the\n * configuration.\n * @param [strictDi] whether the AngularJS injector should have `strictDI` enabled.\n *\n * @publicApi\n */\nexport function createAngularTestingModule(\n angularJSModules: string[],\n strictDi?: boolean,\n): Type<any> {\n angular\n .module_('$$angularJSTestingModule', angularJSModules)\n .constant(ɵconstants.UPGRADE_APP_TYPE_KEY, UpgradeAppType.Static)\n .factory(ɵconstants.INJECTOR_KEY, () => injector);\n $injector = angular.injector(['ng', '$$angularJSTestingModule'], strictDi);\n return AngularTestingModule;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Injector} from '@angular/core';\nimport {TestBed} from '@angular/core/testing';\nimport {ɵangular1 as ng, ɵconstants} from '@angular/upgrade/static';\n\nimport {UpgradeAppType} from '../../../src/common/src/util';\n\n/**\n * A helper function to use when unit testing AngularJS services that depend upon downgraded Angular\n * services.\n *\n * This function returns an AngularJS module that is configured to wire up the AngularJS and Angular\n * injectors without the need to actually bootstrap a hybrid application.\n * This makes it simpler and faster to unit test services.\n *\n * Use the returned AngularJS module in a call to\n * [`angular.mocks.module`](https://docs.angularjs.org/api/ngMock/function/angular.mock.module) to\n * include this module in the unit test injector.\n *\n * In the following code snippet, we are configuring the `$injector` with two modules:\n * The AngularJS `ng1AppModule`, which is the AngularJS part of our hybrid application and the\n * `Ng2AppModule`, which is the Angular part.\n *\n * {@example upgrade/static/ts/full/module.spec.ts region='angularjs-setup'}\n *\n * Once this is done we can get hold of services via the AngularJS `$injector` as normal.\n * Services that are (or have dependencies on) a downgraded Angular service, will be instantiated as\n * needed by the Angular root `Injector`.\n *\n * In the following code snippet, `heroesService` is a downgraded Angular service that we are\n * accessing from AngularJS.\n *\n * {@example upgrade/static/ts/full/module.spec.ts region='angularjs-spec'}\n *\n * <div class=\"docs-alert docs-alert-important\">\n *\n * This helper is for testing services not components.\n * For Component testing you must still bootstrap a hybrid app. See `UpgradeModule` or\n * `downgradeModule` for more information.\n *\n * </div>\n *\n * <div class=\"docs-alert docs-alert-important\">\n *\n * The resulting configuration does not wire up AngularJS digests to Zone hooks. It is the\n * responsibility of the test writer to call `$rootScope.$apply`, as necessary, to trigger\n * AngularJS handlers of async events from Angular.\n *\n * </div>\n *\n * <div class=\"docs-alert docs-alert-important\">\n *\n * The helper sets up global variables to hold the shared Angular and AngularJS injectors.\n *\n * * Only call this helper once per spec.\n * * Do not use `createAngularJSTestingModule` in the same spec as `createAngularTestingModule`.\n *\n * </div>\n *\n * Here is the example application and its unit tests that use `createAngularTestingModule`\n * and `createAngularJSTestingModule`.\n *\n * <code-tabs>\n * <code-pane header=\"module.spec.ts\" path=\"upgrade/static/ts/full/module.spec.ts\"></code-pane>\n * <code-pane header=\"module.ts\" path=\"upgrade/static/ts/full/module.ts\"></code-pane>\n * </code-tabs>\n *\n *\n * @param angularModules a collection of Angular modules to include in the configuration.\n *\n * @publicApi\n */\nexport function createAngularJSTestingModule(angularModules: any[]): string {\n return ng\n .module_('$$angularJSTestingModule', [])\n .constant(ɵconstants.UPGRADE_APP_TYPE_KEY, UpgradeAppType.Static)\n .factory(ɵconstants.INJECTOR_KEY, [\n ɵconstants.$INJECTOR,\n ($injector: ng.IInjectorService) => {\n TestBed.configureTestingModule({\n imports: angularModules,\n providers: [{provide: ɵconstants.$INJECTOR, useValue: $injector}],\n });\n return TestBed.inject(Injector);\n },\n ]).name;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["angular","ng"],"mappings":";;;;;;;;;;;AAaA,IAAI,SAAS,GAAoC,IAAI,CAAA;AACrD,IAAI,QAAkB,CAAA;SAEN,gBAAgB,GAAA;AAC9B,IAAA,OAAO,SAAS,CAAA;AAClB,CAAA;MAGa,oBAAoB,CAAA;AAC/B,IAAA,WAAA,CAAY,CAAW,EAAA;QACrB,QAAQ,GAAG,CAAC,CAAA;KACd;kHAHW,oBAAoB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,QAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;mHAApB,oBAAoB,EAAA,CAAA,CAAA;AAApB,IAAA,OAAA,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CAAC,UAAU,CAAC,YAAY,EAAE;AAChC,QAAA,UAAU,CAAC,SAAS;QACpB,CAAC,SAA8B,KAAI;YACjC,OAAO,CAAC,sBAAsB,CAAC;AAC7B,gBAAA,OAAO,EAAE,cAAc;AACvB,gBAAA,SAAS,EAAE,CAAC,EAAC,OAAO,EAAE,UAAU,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAC,CAAC;AAClE,aAAA,CAAC,CAAA;AACF,YAAA,OAAO,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;SAChC;KACF,CAAC,CAAC,IAAI,CAAA;AACX;;AC7FA;;AAEG;;;;"}
1
+ {"version":3,"file":"testing.mjs","sources":["../../../../../../../packages/upgrade/static/testing/src/create_angular_testing_module.ts","../../../../../../../packages/upgrade/static/testing/src/create_angularjs_testing_module.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Injector, NgModule, Type} from '@angular/core';\nimport {ɵangular1 as angular, ɵconstants} from '@angular/upgrade/static';\n\nimport {UpgradeAppType} from '../../../src/common/src/util';\n\nlet $injector: angular.IInjectorService | null = null;\nlet injector: Injector;\n\nexport function $injectorFactory() {\n return $injector;\n}\n\n@NgModule({providers: [{provide: ɵconstants.$INJECTOR, useFactory: $injectorFactory}]})\nexport class AngularTestingModule {\n constructor(i: Injector) {\n injector = i;\n }\n}\n\n/**\n * A helper function to use when unit testing Angular services that depend upon upgraded AngularJS\n * services.\n *\n * This function returns an `NgModule` decorated class that is configured to wire up the Angular\n * and AngularJS injectors without the need to actually bootstrap a hybrid application.\n * This makes it simpler and faster to unit test services.\n *\n * Use the returned class as an \"import\" when configuring the `TestBed`.\n *\n * In the following code snippet, we are configuring the TestBed with two imports.\n * The `Ng2AppModule` is the Angular part of our hybrid application and the `ng1AppModule` is the\n * AngularJS part.\n *\n * {@example upgrade/static/ts/full/module.spec.ts region='angular-setup'}\n *\n * Once this is done we can get hold of services via the Angular `Injector` as normal.\n * Services that are (or have dependencies on) an upgraded AngularJS service, will be instantiated\n * as needed by the AngularJS `$injector`.\n *\n * In the following code snippet, `HeroesService` is an Angular service that depends upon an\n * AngularJS service, `titleCase`.\n *\n * {@example upgrade/static/ts/full/module.spec.ts region='angular-spec'}\n *\n * <div class=\"docs-alert docs-alert-important\">\n *\n * This helper is for testing services not Components.\n * For Component testing you must still bootstrap a hybrid app. See `UpgradeModule` or\n * `downgradeModule` for more information.\n *\n * </div>\n *\n * <div class=\"docs-alert docs-alert-important\">\n *\n * The resulting configuration does not wire up AngularJS digests to Zone hooks. It is the\n * responsibility of the test writer to call `$rootScope.$apply`, as necessary, to trigger\n * AngularJS handlers of async events from Angular.\n *\n * </div>\n *\n * <div class=\"docs-alert docs-alert-important\">\n *\n * The helper sets up global variables to hold the shared Angular and AngularJS injectors.\n *\n * * Only call this helper once per spec.\n * * Do not use `createAngularTestingModule` in the same spec as `createAngularJSTestingModule`.\n *\n * </div>\n *\n * Here is the example application and its unit tests that use `createAngularTestingModule`\n * and `createAngularJSTestingModule`.\n *\n * <code-tabs>\n * <code-pane header=\"module.spec.ts\" path=\"upgrade/static/ts/full/module.spec.ts\"></code-pane>\n * <code-pane header=\"module.ts\" path=\"upgrade/static/ts/full/module.ts\"></code-pane>\n * </code-tabs>\n *\n *\n * @param angularJSModules a collection of the names of AngularJS modules to include in the\n * configuration.\n * @param [strictDi] whether the AngularJS injector should have `strictDI` enabled.\n *\n * @publicApi\n */\nexport function createAngularTestingModule(\n angularJSModules: string[],\n strictDi?: boolean,\n): Type<any> {\n angular\n .module_('$$angularJSTestingModule', angularJSModules)\n .constant(ɵconstants.UPGRADE_APP_TYPE_KEY, UpgradeAppType.Static)\n .factory(ɵconstants.INJECTOR_KEY, () => injector);\n $injector = angular.injector(['ng', '$$angularJSTestingModule'], strictDi);\n return AngularTestingModule;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Injector} from '@angular/core';\nimport {TestBed} from '@angular/core/testing';\nimport {ɵangular1 as ng, ɵconstants} from '@angular/upgrade/static';\n\nimport {UpgradeAppType} from '../../../src/common/src/util';\n\n/**\n * A helper function to use when unit testing AngularJS services that depend upon downgraded Angular\n * services.\n *\n * This function returns an AngularJS module that is configured to wire up the AngularJS and Angular\n * injectors without the need to actually bootstrap a hybrid application.\n * This makes it simpler and faster to unit test services.\n *\n * Use the returned AngularJS module in a call to\n * [`angular.mocks.module`](https://docs.angularjs.org/api/ngMock/function/angular.mock.module) to\n * include this module in the unit test injector.\n *\n * In the following code snippet, we are configuring the `$injector` with two modules:\n * The AngularJS `ng1AppModule`, which is the AngularJS part of our hybrid application and the\n * `Ng2AppModule`, which is the Angular part.\n *\n * {@example upgrade/static/ts/full/module.spec.ts region='angularjs-setup'}\n *\n * Once this is done we can get hold of services via the AngularJS `$injector` as normal.\n * Services that are (or have dependencies on) a downgraded Angular service, will be instantiated as\n * needed by the Angular root `Injector`.\n *\n * In the following code snippet, `heroesService` is a downgraded Angular service that we are\n * accessing from AngularJS.\n *\n * {@example upgrade/static/ts/full/module.spec.ts region='angularjs-spec'}\n *\n * <div class=\"docs-alert docs-alert-important\">\n *\n * This helper is for testing services not components.\n * For Component testing you must still bootstrap a hybrid app. See `UpgradeModule` or\n * `downgradeModule` for more information.\n *\n * </div>\n *\n * <div class=\"docs-alert docs-alert-important\">\n *\n * The resulting configuration does not wire up AngularJS digests to Zone hooks. It is the\n * responsibility of the test writer to call `$rootScope.$apply`, as necessary, to trigger\n * AngularJS handlers of async events from Angular.\n *\n * </div>\n *\n * <div class=\"docs-alert docs-alert-important\">\n *\n * The helper sets up global variables to hold the shared Angular and AngularJS injectors.\n *\n * * Only call this helper once per spec.\n * * Do not use `createAngularJSTestingModule` in the same spec as `createAngularTestingModule`.\n *\n * </div>\n *\n * Here is the example application and its unit tests that use `createAngularTestingModule`\n * and `createAngularJSTestingModule`.\n *\n * <code-tabs>\n * <code-pane header=\"module.spec.ts\" path=\"upgrade/static/ts/full/module.spec.ts\"></code-pane>\n * <code-pane header=\"module.ts\" path=\"upgrade/static/ts/full/module.ts\"></code-pane>\n * </code-tabs>\n *\n *\n * @param angularModules a collection of Angular modules to include in the configuration.\n *\n * @publicApi\n */\nexport function createAngularJSTestingModule(angularModules: any[]): string {\n return ng\n .module_('$$angularJSTestingModule', [])\n .constant(ɵconstants.UPGRADE_APP_TYPE_KEY, UpgradeAppType.Static)\n .factory(ɵconstants.INJECTOR_KEY, [\n ɵconstants.$INJECTOR,\n ($injector: ng.IInjectorService) => {\n TestBed.configureTestingModule({\n imports: angularModules,\n providers: [{provide: ɵconstants.$INJECTOR, useValue: $injector}],\n });\n return TestBed.inject(Injector);\n },\n ]).name;\n}\n"],"names":["ɵconstants","angular","ng"],"mappings":";;;;;;;;;;;AAaA,IAAI,SAAS,GAAoC,IAAI;AACrD,IAAI,QAAkB;SAEN,gBAAgB,GAAA;AAC9B,IAAA,OAAO,SAAS;AAClB;MAGa,oBAAoB,CAAA;AAC/B,IAAA,WAAA,CAAY,CAAW,EAAA;QACrB,QAAQ,GAAG,CAAC;;kHAFH,oBAAoB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,QAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;mHAApB,oBAAoB,EAAA,CAAA;AAApB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,mBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,EADX,SAAA,EAAA,CAAC,EAAC,OAAO,EAAEA,UAAU,CAAC,SAAS,EAAE,UAAU,EAAE,gBAAgB,EAAC,CAAC,EAAA,CAAA;;sGACxE,oBAAoB,EAAA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