@angular/upgrade 21.0.0-next.8 → 21.0.0-rc.0

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.
@@ -1,74 +1,47 @@
1
1
  /**
2
- * @license Angular v21.0.0-next.8
2
+ * @license Angular v21.0.0-rc.0
3
3
  * (c) 2010-2025 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
6
6
 
7
7
  function noNg() {
8
- throw new Error('AngularJS v1.x is not loaded!');
8
+ throw new Error('AngularJS v1.x is not loaded!');
9
9
  }
10
- const noNgElement = (() => noNg());
10
+ const noNgElement = () => noNg();
11
11
  noNgElement.cleanData = noNg;
12
12
  let angular = {
13
- bootstrap: noNg,
14
- module: noNg,
15
- element: noNgElement,
16
- injector: noNg,
17
- version: undefined,
18
- resumeBootstrap: noNg,
19
- getTestability: noNg,
13
+ bootstrap: noNg,
14
+ module: noNg,
15
+ element: noNgElement,
16
+ injector: noNg,
17
+ version: undefined,
18
+ resumeBootstrap: noNg,
19
+ getTestability: noNg
20
20
  };
21
21
  try {
22
- if (window.hasOwnProperty('angular')) {
23
- angular = window.angular;
24
- }
25
- }
26
- catch {
27
- // ignore in CJS mode.
28
- }
29
- /**
30
- * @deprecated Use `setAngularJSGlobal` instead.
31
- *
32
- * @publicApi
33
- */
22
+ if (window.hasOwnProperty('angular')) {
23
+ angular = window.angular;
24
+ }
25
+ } catch {}
34
26
  function setAngularLib(ng) {
35
- setAngularJSGlobal(ng);
27
+ setAngularJSGlobal(ng);
36
28
  }
37
- /**
38
- * @deprecated Use `getAngularJSGlobal` instead.
39
- *
40
- * @publicApi
41
- */
42
29
  function getAngularLib() {
43
- return getAngularJSGlobal();
30
+ return getAngularJSGlobal();
44
31
  }
45
- /**
46
- * Resets the AngularJS global.
47
- *
48
- * Used when AngularJS is loaded lazily, and not available on `window`.
49
- *
50
- * @publicApi
51
- */
52
32
  function setAngularJSGlobal(ng) {
53
- angular = ng;
33
+ angular = ng;
54
34
  }
55
- /**
56
- * Returns the current AngularJS global.
57
- *
58
- * @publicApi
59
- */
60
35
  function getAngularJSGlobal() {
61
- return angular;
36
+ return angular;
62
37
  }
63
38
  const bootstrap = (e, modules, config) => angular.bootstrap(e, modules, config);
64
- // Do not declare as `module` to avoid webpack bug
65
- // (see https://github.com/angular/angular/issues/30050).
66
39
  const module_ = (prefix, dependencies) => angular.module(prefix, dependencies);
67
- const element = ((e) => angular.element(e));
68
- element.cleanData = (nodes) => angular.element.cleanData(nodes);
40
+ const element = e => angular.element(e);
41
+ element.cleanData = nodes => angular.element.cleanData(nodes);
69
42
  const injector = (modules, strictDi) => angular.injector(modules, strictDi);
70
43
  const resumeBootstrap = () => angular.resumeBootstrap();
71
- const getTestability = (e) => angular.getTestability(e);
44
+ const getTestability = e => angular.getTestability(e);
72
45
 
73
46
  var angular1 = /*#__PURE__*/Object.freeze({
74
47
  __proto__: null,
@@ -1 +1 @@
1
- {"version":3,"file":"_constants-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/upgrade/src/common/src/angular1.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/upgrade/src/common/src/constants.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\nexport type Ng1Token = string;\n\nexport type Ng1Expression = string | Function;\n\nexport interface IAnnotatedFunction extends Function {\n // Older versions of `@types/angular` typings extend the global `Function` interface with\n // `$inject?: string[]`, which is not compatible with `$inject?: ReadonlyArray<string>` (used in\n // latest versions).\n $inject?: Function extends {$inject?: string[]} ? Ng1Token[] : ReadonlyArray<Ng1Token>;\n}\n\nexport type IInjectable = (Ng1Token | Function)[] | IAnnotatedFunction;\n\nexport type SingleOrListOrMap<T> = T | T[] | {[key: string]: T};\n\nexport interface IModule {\n name: string;\n requires: (string | IInjectable)[];\n config(fn: IInjectable): IModule;\n directive(selector: string, factory: IInjectable): IModule;\n component(selector: string, component: IComponent): IModule;\n controller(name: string, type: IInjectable): IModule;\n factory(key: Ng1Token, factoryFn: IInjectable): IModule;\n value(key: Ng1Token, value: any): IModule;\n constant(token: Ng1Token, value: any): IModule;\n run(a: IInjectable): IModule;\n}\nexport interface ICompileService {\n (element: Element | NodeList | Node[] | string, transclude?: Function): ILinkFn;\n}\nexport interface ILinkFn {\n (scope: IScope, cloneAttachFn?: ICloneAttachFunction, options?: ILinkFnOptions): IAugmentedJQuery;\n $$slots?: {[slotName: string]: ILinkFn};\n}\nexport interface ILinkFnOptions {\n parentBoundTranscludeFn?: Function;\n transcludeControllers?: {[key: string]: any};\n futureParentElement?: Node;\n}\nexport interface IRootScopeService {\n $new(isolate?: boolean): IScope;\n $id: string;\n $parent: IScope;\n $root: IScope;\n $watch(exp: Ng1Expression, fn?: (a1?: any, a2?: any) => void): Function;\n $on(event: string, fn?: (event?: any, ...args: any[]) => void): Function;\n $destroy(): any;\n $apply(exp?: Ng1Expression): any;\n $digest(): any;\n $evalAsync(exp: Ng1Expression, locals?: any): void;\n $on(event: string, fn?: (event?: any, ...args: any[]) => void): Function;\n $$childTail: IScope;\n $$childHead: IScope;\n $$nextSibling: IScope;\n $$phase: any;\n [key: string]: any;\n}\nexport interface IScope extends IRootScopeService {}\n\nexport interface IAngularBootstrapConfig {\n strictDi?: boolean;\n}\nexport interface IDirective {\n compile?: IDirectiveCompileFn;\n controller?: IController;\n controllerAs?: string;\n bindToController?: boolean | {[key: string]: string};\n link?: IDirectiveLinkFn | IDirectivePrePost;\n name?: string;\n priority?: number;\n replace?: boolean;\n require?: DirectiveRequireProperty;\n restrict?: string;\n scope?: boolean | {[key: string]: string};\n template?: string | Function;\n templateUrl?: string | Function;\n templateNamespace?: string;\n terminal?: boolean;\n transclude?: DirectiveTranscludeProperty;\n}\nexport type DirectiveRequireProperty = SingleOrListOrMap<string>;\nexport type DirectiveTranscludeProperty = boolean | 'element' | {[key: string]: string};\nexport interface IDirectiveCompileFn {\n (\n templateElement: IAugmentedJQuery,\n templateAttributes: IAttributes,\n transclude: ITranscludeFunction,\n ): IDirectivePrePost;\n}\nexport interface IDirectivePrePost {\n pre?: IDirectiveLinkFn;\n post?: IDirectiveLinkFn;\n}\nexport interface IDirectiveLinkFn {\n (\n scope: IScope,\n instanceElement: IAugmentedJQuery,\n instanceAttributes: IAttributes,\n controller: any,\n transclude: ITranscludeFunction,\n ): void;\n}\nexport interface IComponent {\n bindings?: {[key: string]: string};\n controller?: string | IInjectable;\n controllerAs?: string;\n require?: DirectiveRequireProperty;\n template?: string | Function;\n templateUrl?: string | Function;\n transclude?: DirectiveTranscludeProperty;\n}\nexport interface IAttributes {\n $observe(attr: string, fn: (v: string) => void): void;\n [key: string]: any;\n}\nexport interface ITranscludeFunction {\n // If the scope is provided, then the cloneAttachFn must be as well.\n (scope: IScope, cloneAttachFn: ICloneAttachFunction): IAugmentedJQuery;\n // If one argument is provided, then it's assumed to be the cloneAttachFn.\n (cloneAttachFn?: ICloneAttachFunction): IAugmentedJQuery;\n}\nexport interface ICloneAttachFunction {\n (clonedElement: IAugmentedJQuery, scope: IScope): any;\n}\nexport type IAugmentedJQuery = Node[] & {\n on?: (name: string, fn: () => void) => void;\n data?: (name: string, value?: any) => any;\n text?: () => string;\n inheritedData?: (name: string, value?: any) => any;\n children?: () => IAugmentedJQuery;\n contents?: () => IAugmentedJQuery;\n parent?: () => IAugmentedJQuery;\n empty?: () => void;\n append?: (content: IAugmentedJQuery | string) => IAugmentedJQuery;\n controller?: (name: string) => any;\n isolateScope?: () => IScope;\n injector?: () => IInjectorService;\n triggerHandler?: (eventTypeOrObject: string | Event, extraParameters?: any[]) => IAugmentedJQuery;\n remove?: () => void;\n removeData?: () => void;\n};\nexport interface IProvider {\n $get: IInjectable;\n}\nexport interface IProvideService {\n provider(token: Ng1Token, provider: IProvider): IProvider;\n factory(token: Ng1Token, factory: IInjectable): IProvider;\n service(token: Ng1Token, type: IInjectable): IProvider;\n value(token: Ng1Token, value: any): IProvider;\n constant(token: Ng1Token, value: any): void;\n decorator(token: Ng1Token, factory: IInjectable): void;\n}\nexport interface IParseService {\n (expression: string): ICompiledExpression;\n}\nexport interface ICompiledExpression {\n (context: any, locals: any): any;\n assign?: (context: any, value: any) => any;\n}\nexport interface IHttpBackendService {\n (\n method: string,\n url: string,\n post?: any,\n callback?: Function,\n headers?: any,\n timeout?: number,\n withCredentials?: boolean,\n ): void;\n}\nexport interface ICacheObject {\n put<T>(key: string, value?: T): T;\n get(key: string): any;\n}\nexport interface ITemplateCacheService extends ICacheObject {}\nexport type IController = string | IInjectable;\nexport interface IControllerService {\n (controllerConstructor: IController, locals?: any, later?: any, ident?: any): any;\n (controllerName: string, locals?: any): any;\n}\n\nexport interface IInjectorService {\n get(key: string): any;\n has(key: string): boolean;\n}\n\nexport interface IIntervalService {\n (\n func: Function,\n delay: number,\n count?: number,\n invokeApply?: boolean,\n ...args: any[]\n ): Promise<any>;\n cancel(promise: Promise<any>): boolean;\n}\n\nexport interface ITestabilityService {\n findBindings(element: Element, expression: string, opt_exactMatch?: boolean): Element[];\n findModels(element: Element, expression: string, opt_exactMatch?: boolean): Element[];\n getLocation(): string;\n setLocation(url: string): void;\n whenStable(callback: Function): void;\n}\n\nexport interface INgModelController {\n $render(): void;\n $isEmpty(value: any): boolean;\n $setValidity(validationErrorKey: string, isValid: boolean): void;\n $setPristine(): void;\n $setDirty(): void;\n $setUntouched(): void;\n $setTouched(): void;\n $rollbackViewValue(): void;\n $validate(): void;\n $commitViewValue(): void;\n $setViewValue(value: any, trigger: string): void;\n\n $viewValue: any;\n $modelValue: any;\n $parsers: Function[];\n $formatters: Function[];\n $validators: {[key: string]: Function};\n $asyncValidators: {[key: string]: Function};\n $viewChangeListeners: Function[];\n $error: Object;\n $pending: Object;\n $untouched: boolean;\n $touched: boolean;\n $pristine: boolean;\n $dirty: boolean;\n $valid: boolean;\n $invalid: boolean;\n $name: string;\n}\n\nfunction noNg(): never {\n throw new Error('AngularJS v1.x is not loaded!');\n}\n\nconst noNgElement: typeof angular.element = (() => noNg()) as any;\nnoNgElement.cleanData = noNg;\n\nlet angular: {\n bootstrap: (\n e: Element,\n modules: (string | IInjectable)[],\n config?: IAngularBootstrapConfig,\n ) => IInjectorService;\n module: (prefix: string, dependencies?: string[]) => IModule;\n element: {\n (e: string | Element | Document | IAugmentedJQuery): IAugmentedJQuery;\n cleanData: (nodes: Node[] | NodeList) => void;\n };\n injector: (modules: Array<string | IInjectable>, strictDi?: boolean) => IInjectorService;\n version: {major: number};\n resumeBootstrap: () => void;\n getTestability: (e: Element) => ITestabilityService;\n} = {\n bootstrap: noNg,\n module: noNg,\n element: noNgElement,\n injector: noNg,\n version: undefined as any,\n resumeBootstrap: noNg,\n getTestability: noNg,\n};\n\ntry {\n if (window.hasOwnProperty('angular')) {\n angular = (<any>window).angular;\n }\n} catch {\n // ignore in CJS mode.\n}\n\n/**\n * @deprecated Use `setAngularJSGlobal` instead.\n *\n * @publicApi\n */\nexport function setAngularLib(ng: any): void {\n setAngularJSGlobal(ng);\n}\n\n/**\n * @deprecated Use `getAngularJSGlobal` instead.\n *\n * @publicApi\n */\nexport function getAngularLib(): any {\n return getAngularJSGlobal();\n}\n\n/**\n * Resets the AngularJS global.\n *\n * Used when AngularJS is loaded lazily, and not available on `window`.\n *\n * @publicApi\n */\nexport function setAngularJSGlobal(ng: any): void {\n angular = ng;\n}\n\n/**\n * Returns the current AngularJS global.\n *\n * @publicApi\n */\nexport function getAngularJSGlobal(): any {\n return angular;\n}\n\nexport const bootstrap: typeof angular.bootstrap = (e, modules, config?) =>\n angular.bootstrap(e, modules, config);\n\n// Do not declare as `module` to avoid webpack bug\n// (see https://github.com/angular/angular/issues/30050).\nexport const module_: typeof angular.module = (prefix, dependencies?) =>\n angular.module(prefix, dependencies);\n\nexport const element: typeof angular.element = ((e) =>\n angular.element(e)) as typeof angular.element;\nelement.cleanData = (nodes) => angular.element.cleanData(nodes);\n\nexport const injector: typeof angular.injector = (\n modules: Array<string | IInjectable>,\n strictDi?: boolean,\n) => angular.injector(modules, strictDi);\n\nexport const resumeBootstrap: typeof angular.resumeBootstrap = () => angular.resumeBootstrap();\n\nexport const getTestability: typeof angular.getTestability = (e) => angular.getTestability(e);\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\nexport const $COMPILE = '$compile';\nexport const $CONTROLLER = '$controller';\nexport const $DELEGATE = '$delegate';\nexport const $EXCEPTION_HANDLER = '$exceptionHandler';\nexport const $HTTP_BACKEND = '$httpBackend';\nexport const $INJECTOR = '$injector';\nexport const $INTERVAL = '$interval';\nexport const $PARSE = '$parse';\nexport const $PROVIDE = '$provide';\nexport const $ROOT_ELEMENT = '$rootElement';\nexport const $ROOT_SCOPE = '$rootScope';\nexport const $SCOPE = '$scope';\nexport const $TEMPLATE_CACHE = '$templateCache';\nexport const $TEMPLATE_REQUEST = '$templateRequest';\n\nexport const $$TESTABILITY = '$$testability';\n\nexport const COMPILER_KEY = '$$angularCompiler';\nexport const DOWNGRADED_MODULE_COUNT_KEY = '$$angularDowngradedModuleCount';\nexport const GROUP_PROJECTABLE_NODES_KEY = '$$angularGroupProjectableNodes';\nexport const INJECTOR_KEY = '$$angularInjector';\nexport const LAZY_MODULE_REF = '$$angularLazyModuleRef';\nexport const NG_ZONE_KEY = '$$angularNgZone';\nexport const UPGRADE_APP_TYPE_KEY = '$$angularUpgradeAppType';\n\nexport const REQUIRE_INJECTOR = '?^^' + INJECTOR_KEY;\nexport const REQUIRE_NG_MODEL = '?ngModel';\n\nexport const UPGRADE_MODULE_NAME = '$$UpgradeModule';\n"],"names":[],"mappings":";;;;;;AAoPA,SAAS,IAAI,GAAA;AACX,IAAA,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC;AAClD;AAEA,MAAM,WAAW,IAA4B,MAAM,IAAI,EAAE,CAAQ;AACjE,WAAW,CAAC,SAAS,GAAG,IAAI;AAE5B,IAAI,OAAO,GAeP;AACF,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,MAAM,EAAE,IAAI;AACZ,IAAA,OAAO,EAAE,WAAW;AACpB,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,OAAO,EAAE,SAAgB;AACzB,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,cAAc,EAAE,IAAI;CACrB;AAED,IAAI;AACF,IAAA,IAAI,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE;AACpC,QAAA,OAAO,GAAS,MAAO,CAAC,OAAO;;AAEnC;AAAE,MAAM;;AAER;AAEA;;;;AAIG;AACG,SAAU,aAAa,CAAC,EAAO,EAAA;IACnC,kBAAkB,CAAC,EAAE,CAAC;AACxB;AAEA;;;;AAIG;SACa,aAAa,GAAA;IAC3B,OAAO,kBAAkB,EAAE;AAC7B;AAEA;;;;;;AAMG;AACG,SAAU,kBAAkB,CAAC,EAAO,EAAA;IACxC,OAAO,GAAG,EAAE;AACd;AAEA;;;;AAIG;SACa,kBAAkB,GAAA;AAChC,IAAA,OAAO,OAAO;AAChB;MAEa,SAAS,GAA6B,CAAC,CAAC,EAAE,OAAO,EAAE,MAAO,KACrE,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM;AAEtC;AACA;AACa,MAAA,OAAO,GAA0B,CAAC,MAAM,EAAE,YAAa,KAClE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY;AAExB,MAAA,OAAO,IAA4B,CAAC,CAAC,KAChD,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;AACpB,OAAO,CAAC,SAAS,GAAG,CAAC,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC;AAElD,MAAA,QAAQ,GAA4B,CAC/C,OAAoC,EACpC,QAAkB,KACf,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ;AAEhC,MAAM,eAAe,GAAmC,MAAM,OAAO,CAAC,eAAe,EAAE;AAEvF,MAAM,cAAc,GAAkC,CAAC,CAAC,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;AC7UtF,MAAM,QAAQ,GAAG;AACjB,MAAM,WAAW,GAAG;AACpB,MAAM,SAAS,GAAG;AAClB,MAAM,kBAAkB,GAAG,mBAAmB;AAC9C,MAAM,aAAa,GAAG;AACtB,MAAM,SAAS,GAAG;AAClB,MAAM,SAAS,GAAG;AAClB,MAAM,MAAM,GAAG;AACf,MAAM,QAAQ,GAAG;AACjB,MAAM,aAAa,GAAG;AACtB,MAAM,WAAW,GAAG;AACpB,MAAM,MAAM,GAAG;AACf,MAAM,eAAe,GAAG;AACxB,MAAM,iBAAiB,GAAG,kBAAkB;AAE5C,MAAM,aAAa,GAAG;AAEtB,MAAM,YAAY,GAAG,mBAAmB;AACxC,MAAM,2BAA2B,GAAG;AACpC,MAAM,2BAA2B,GAAG,gCAAgC;AACpE,MAAM,YAAY,GAAG;AACrB,MAAM,eAAe,GAAG;AACxB,MAAM,WAAW,GAAG,iBAAiB;AACrC,MAAM,oBAAoB,GAAG;AAEvB,MAAA,gBAAgB,GAAG,KAAK,GAAG;AACjC,MAAM,gBAAgB,GAAG;AAEzB,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"_constants-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/upgrade/src/common/src/angular1.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/upgrade/src/common/src/constants.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\nexport type Ng1Token = string;\n\nexport type Ng1Expression = string | Function;\n\nexport interface IAnnotatedFunction extends Function {\n // Older versions of `@types/angular` typings extend the global `Function` interface with\n // `$inject?: string[]`, which is not compatible with `$inject?: ReadonlyArray<string>` (used in\n // latest versions).\n $inject?: Function extends {$inject?: string[]} ? Ng1Token[] : ReadonlyArray<Ng1Token>;\n}\n\nexport type IInjectable = (Ng1Token | Function)[] | IAnnotatedFunction;\n\nexport type SingleOrListOrMap<T> = T | T[] | {[key: string]: T};\n\nexport interface IModule {\n name: string;\n requires: (string | IInjectable)[];\n config(fn: IInjectable): IModule;\n directive(selector: string, factory: IInjectable): IModule;\n component(selector: string, component: IComponent): IModule;\n controller(name: string, type: IInjectable): IModule;\n factory(key: Ng1Token, factoryFn: IInjectable): IModule;\n value(key: Ng1Token, value: any): IModule;\n constant(token: Ng1Token, value: any): IModule;\n run(a: IInjectable): IModule;\n}\nexport interface ICompileService {\n (element: Element | NodeList | Node[] | string, transclude?: Function): ILinkFn;\n}\nexport interface ILinkFn {\n (scope: IScope, cloneAttachFn?: ICloneAttachFunction, options?: ILinkFnOptions): IAugmentedJQuery;\n $$slots?: {[slotName: string]: ILinkFn};\n}\nexport interface ILinkFnOptions {\n parentBoundTranscludeFn?: Function;\n transcludeControllers?: {[key: string]: any};\n futureParentElement?: Node;\n}\nexport interface IRootScopeService {\n $new(isolate?: boolean): IScope;\n $id: string;\n $parent: IScope;\n $root: IScope;\n $watch(exp: Ng1Expression, fn?: (a1?: any, a2?: any) => void): Function;\n $on(event: string, fn?: (event?: any, ...args: any[]) => void): Function;\n $destroy(): any;\n $apply(exp?: Ng1Expression): any;\n $digest(): any;\n $evalAsync(exp: Ng1Expression, locals?: any): void;\n $on(event: string, fn?: (event?: any, ...args: any[]) => void): Function;\n $$childTail: IScope;\n $$childHead: IScope;\n $$nextSibling: IScope;\n $$phase: any;\n [key: string]: any;\n}\nexport interface IScope extends IRootScopeService {}\n\nexport interface IAngularBootstrapConfig {\n strictDi?: boolean;\n}\nexport interface IDirective {\n compile?: IDirectiveCompileFn;\n controller?: IController;\n controllerAs?: string;\n bindToController?: boolean | {[key: string]: string};\n link?: IDirectiveLinkFn | IDirectivePrePost;\n name?: string;\n priority?: number;\n replace?: boolean;\n require?: DirectiveRequireProperty;\n restrict?: string;\n scope?: boolean | {[key: string]: string};\n template?: string | Function;\n templateUrl?: string | Function;\n templateNamespace?: string;\n terminal?: boolean;\n transclude?: DirectiveTranscludeProperty;\n}\nexport type DirectiveRequireProperty = SingleOrListOrMap<string>;\nexport type DirectiveTranscludeProperty = boolean | 'element' | {[key: string]: string};\nexport interface IDirectiveCompileFn {\n (\n templateElement: IAugmentedJQuery,\n templateAttributes: IAttributes,\n transclude: ITranscludeFunction,\n ): IDirectivePrePost;\n}\nexport interface IDirectivePrePost {\n pre?: IDirectiveLinkFn;\n post?: IDirectiveLinkFn;\n}\nexport interface IDirectiveLinkFn {\n (\n scope: IScope,\n instanceElement: IAugmentedJQuery,\n instanceAttributes: IAttributes,\n controller: any,\n transclude: ITranscludeFunction,\n ): void;\n}\nexport interface IComponent {\n bindings?: {[key: string]: string};\n controller?: string | IInjectable;\n controllerAs?: string;\n require?: DirectiveRequireProperty;\n template?: string | Function;\n templateUrl?: string | Function;\n transclude?: DirectiveTranscludeProperty;\n}\nexport interface IAttributes {\n $observe(attr: string, fn: (v: string) => void): void;\n [key: string]: any;\n}\nexport interface ITranscludeFunction {\n // If the scope is provided, then the cloneAttachFn must be as well.\n (scope: IScope, cloneAttachFn: ICloneAttachFunction): IAugmentedJQuery;\n // If one argument is provided, then it's assumed to be the cloneAttachFn.\n (cloneAttachFn?: ICloneAttachFunction): IAugmentedJQuery;\n}\nexport interface ICloneAttachFunction {\n (clonedElement: IAugmentedJQuery, scope: IScope): any;\n}\nexport type IAugmentedJQuery = Node[] & {\n on?: (name: string, fn: () => void) => void;\n data?: (name: string, value?: any) => any;\n text?: () => string;\n inheritedData?: (name: string, value?: any) => any;\n children?: () => IAugmentedJQuery;\n contents?: () => IAugmentedJQuery;\n parent?: () => IAugmentedJQuery;\n empty?: () => void;\n append?: (content: IAugmentedJQuery | string) => IAugmentedJQuery;\n controller?: (name: string) => any;\n isolateScope?: () => IScope;\n injector?: () => IInjectorService;\n triggerHandler?: (eventTypeOrObject: string | Event, extraParameters?: any[]) => IAugmentedJQuery;\n remove?: () => void;\n removeData?: () => void;\n};\nexport interface IProvider {\n $get: IInjectable;\n}\nexport interface IProvideService {\n provider(token: Ng1Token, provider: IProvider): IProvider;\n factory(token: Ng1Token, factory: IInjectable): IProvider;\n service(token: Ng1Token, type: IInjectable): IProvider;\n value(token: Ng1Token, value: any): IProvider;\n constant(token: Ng1Token, value: any): void;\n decorator(token: Ng1Token, factory: IInjectable): void;\n}\nexport interface IParseService {\n (expression: string): ICompiledExpression;\n}\nexport interface ICompiledExpression {\n (context: any, locals: any): any;\n assign?: (context: any, value: any) => any;\n}\nexport interface IHttpBackendService {\n (\n method: string,\n url: string,\n post?: any,\n callback?: Function,\n headers?: any,\n timeout?: number,\n withCredentials?: boolean,\n ): void;\n}\nexport interface ICacheObject {\n put<T>(key: string, value?: T): T;\n get(key: string): any;\n}\nexport interface ITemplateCacheService extends ICacheObject {}\nexport type IController = string | IInjectable;\nexport interface IControllerService {\n (controllerConstructor: IController, locals?: any, later?: any, ident?: any): any;\n (controllerName: string, locals?: any): any;\n}\n\nexport interface IInjectorService {\n get(key: string): any;\n has(key: string): boolean;\n}\n\nexport interface IIntervalService {\n (\n func: Function,\n delay: number,\n count?: number,\n invokeApply?: boolean,\n ...args: any[]\n ): Promise<any>;\n cancel(promise: Promise<any>): boolean;\n}\n\nexport interface ITestabilityService {\n findBindings(element: Element, expression: string, opt_exactMatch?: boolean): Element[];\n findModels(element: Element, expression: string, opt_exactMatch?: boolean): Element[];\n getLocation(): string;\n setLocation(url: string): void;\n whenStable(callback: Function): void;\n}\n\nexport interface INgModelController {\n $render(): void;\n $isEmpty(value: any): boolean;\n $setValidity(validationErrorKey: string, isValid: boolean): void;\n $setPristine(): void;\n $setDirty(): void;\n $setUntouched(): void;\n $setTouched(): void;\n $rollbackViewValue(): void;\n $validate(): void;\n $commitViewValue(): void;\n $setViewValue(value: any, trigger: string): void;\n\n $viewValue: any;\n $modelValue: any;\n $parsers: Function[];\n $formatters: Function[];\n $validators: {[key: string]: Function};\n $asyncValidators: {[key: string]: Function};\n $viewChangeListeners: Function[];\n $error: Object;\n $pending: Object;\n $untouched: boolean;\n $touched: boolean;\n $pristine: boolean;\n $dirty: boolean;\n $valid: boolean;\n $invalid: boolean;\n $name: string;\n}\n\nfunction noNg(): never {\n throw new Error('AngularJS v1.x is not loaded!');\n}\n\nconst noNgElement: typeof angular.element = (() => noNg()) as any;\nnoNgElement.cleanData = noNg;\n\nlet angular: {\n bootstrap: (\n e: Element,\n modules: (string | IInjectable)[],\n config?: IAngularBootstrapConfig,\n ) => IInjectorService;\n module: (prefix: string, dependencies?: string[]) => IModule;\n element: {\n (e: string | Element | Document | IAugmentedJQuery): IAugmentedJQuery;\n cleanData: (nodes: Node[] | NodeList) => void;\n };\n injector: (modules: Array<string | IInjectable>, strictDi?: boolean) => IInjectorService;\n version: {major: number};\n resumeBootstrap: () => void;\n getTestability: (e: Element) => ITestabilityService;\n} = {\n bootstrap: noNg,\n module: noNg,\n element: noNgElement,\n injector: noNg,\n version: undefined as any,\n resumeBootstrap: noNg,\n getTestability: noNg,\n};\n\ntry {\n if (window.hasOwnProperty('angular')) {\n angular = (<any>window).angular;\n }\n} catch {\n // ignore in CJS mode.\n}\n\n/**\n * @deprecated Use `setAngularJSGlobal` instead.\n *\n * @publicApi\n */\nexport function setAngularLib(ng: any): void {\n setAngularJSGlobal(ng);\n}\n\n/**\n * @deprecated Use `getAngularJSGlobal` instead.\n *\n * @publicApi\n */\nexport function getAngularLib(): any {\n return getAngularJSGlobal();\n}\n\n/**\n * Resets the AngularJS global.\n *\n * Used when AngularJS is loaded lazily, and not available on `window`.\n *\n * @publicApi\n */\nexport function setAngularJSGlobal(ng: any): void {\n angular = ng;\n}\n\n/**\n * Returns the current AngularJS global.\n *\n * @publicApi\n */\nexport function getAngularJSGlobal(): any {\n return angular;\n}\n\nexport const bootstrap: typeof angular.bootstrap = (e, modules, config?) =>\n angular.bootstrap(e, modules, config);\n\n// Do not declare as `module` to avoid webpack bug\n// (see https://github.com/angular/angular/issues/30050).\nexport const module_: typeof angular.module = (prefix, dependencies?) =>\n angular.module(prefix, dependencies);\n\nexport const element: typeof angular.element = ((e) =>\n angular.element(e)) as typeof angular.element;\nelement.cleanData = (nodes) => angular.element.cleanData(nodes);\n\nexport const injector: typeof angular.injector = (\n modules: Array<string | IInjectable>,\n strictDi?: boolean,\n) => angular.injector(modules, strictDi);\n\nexport const resumeBootstrap: typeof angular.resumeBootstrap = () => angular.resumeBootstrap();\n\nexport const getTestability: typeof angular.getTestability = (e) => angular.getTestability(e);\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\nexport const $COMPILE = '$compile';\nexport const $CONTROLLER = '$controller';\nexport const $DELEGATE = '$delegate';\nexport const $EXCEPTION_HANDLER = '$exceptionHandler';\nexport const $HTTP_BACKEND = '$httpBackend';\nexport const $INJECTOR = '$injector';\nexport const $INTERVAL = '$interval';\nexport const $PARSE = '$parse';\nexport const $PROVIDE = '$provide';\nexport const $ROOT_ELEMENT = '$rootElement';\nexport const $ROOT_SCOPE = '$rootScope';\nexport const $SCOPE = '$scope';\nexport const $TEMPLATE_CACHE = '$templateCache';\nexport const $TEMPLATE_REQUEST = '$templateRequest';\n\nexport const $$TESTABILITY = '$$testability';\n\nexport const COMPILER_KEY = '$$angularCompiler';\nexport const DOWNGRADED_MODULE_COUNT_KEY = '$$angularDowngradedModuleCount';\nexport const GROUP_PROJECTABLE_NODES_KEY = '$$angularGroupProjectableNodes';\nexport const INJECTOR_KEY = '$$angularInjector';\nexport const LAZY_MODULE_REF = '$$angularLazyModuleRef';\nexport const NG_ZONE_KEY = '$$angularNgZone';\nexport const UPGRADE_APP_TYPE_KEY = '$$angularUpgradeAppType';\n\nexport const REQUIRE_INJECTOR = '?^^' + INJECTOR_KEY;\nexport const REQUIRE_NG_MODEL = '?ngModel';\n\nexport const UPGRADE_MODULE_NAME = '$$UpgradeModule';\n"],"names":["noNg","bootstrap","$COMPILE","$INTERVAL","$PARSE","$PROVIDE","$ROOT_ELEMENT","$ROOT_SCOPE","$SCOPE","$TEMPLATE_CACHE","$TEMPLATE_REQUEST","$$TESTABILITY","COMPILER_KEY","DOWNGRADED_MODULE_COUNT_KEY","GROUP_PROJECTABLE_NODES_KEY","INJECTOR_KEY","LAZY_MODULE_REF","NG_ZONE_KEY","UPGRADE_APP_TYPE_KEY"],"mappings":";;;;;;AAoPA,SAAAA,IAAA,GAAA;;;;;;AAuBEC,EAAAA,SAAA,EAAAD,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACnQF,MAAAE,QAAA,GAAA;;;;;;AAMA,MAAAC,SAAA,GAAA;AAEO,MAAMC,MAAA,GAAQ;AACd,MAAMC,QAAA,GAAa;AACnB,MAAMC,aAAW;AACjB,MAAMC,WAAA,GAAiB;AACvB,MAAMC,MAAA,GAAe;AACrB,MAAMC,eAAiB;AAEvB,MAAMC,iBAAa;AAEnB,MAAMC,aAAY;AAClB,MAAMC,YAA2B,GAAA,mBAAA;AACjC,MAAMC,2BAA2B,GAAG;AACpC,MAAMC;AACN,MAAMC,YAAe,GAAG;AACxB,MAAMC;AACN,MAAMC,WAAA,GAAoB,iBAAA;AAG1B,MAAMC,oBAAgB,GAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.0.0-next.8
2
+ * @license Angular v21.0.0-rc.0
3
3
  * (c) 2010-2025 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -12,171 +12,74 @@ import { TestBed } from '@angular/core/testing';
12
12
  let $injector = null;
13
13
  let injector;
14
14
  function $injectorFactory() {
15
- return $injector;
15
+ return $injector;
16
16
  }
17
17
  class AngularTestingModule {
18
- constructor(i) {
19
- injector = i;
20
- }
21
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.8", ngImport: i0, type: AngularTestingModule, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.NgModule });
22
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.0-next.8", ngImport: i0, type: AngularTestingModule });
23
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.0-next.8", ngImport: i0, type: AngularTestingModule, providers: [{ provide: $INJECTOR, useFactory: $injectorFactory }] });
18
+ constructor(i) {
19
+ injector = i;
20
+ }
21
+ static ɵfac = i0.ɵɵngDeclareFactory({
22
+ minVersion: "12.0.0",
23
+ version: "21.0.0-rc.0",
24
+ ngImport: i0,
25
+ type: AngularTestingModule,
26
+ deps: [{
27
+ token: i0.Injector
28
+ }],
29
+ target: i0.ɵɵFactoryTarget.NgModule
30
+ });
31
+ static ɵmod = i0.ɵɵngDeclareNgModule({
32
+ minVersion: "14.0.0",
33
+ version: "21.0.0-rc.0",
34
+ ngImport: i0,
35
+ type: AngularTestingModule
36
+ });
37
+ static ɵinj = i0.ɵɵngDeclareInjector({
38
+ minVersion: "12.0.0",
39
+ version: "21.0.0-rc.0",
40
+ ngImport: i0,
41
+ type: AngularTestingModule,
42
+ providers: [{
43
+ provide: $INJECTOR,
44
+ useFactory: $injectorFactory
45
+ }]
46
+ });
24
47
  }
25
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.8", ngImport: i0, type: AngularTestingModule, decorators: [{
26
- type: NgModule,
27
- args: [{ providers: [{ provide: $INJECTOR, useFactory: $injectorFactory }] }]
28
- }], ctorParameters: () => [{ type: i0.Injector }] });
29
- /**
30
- * A helper function to use when unit testing Angular services that depend upon upgraded AngularJS
31
- * services.
32
- *
33
- * This function returns an `NgModule` decorated class that is configured to wire up the Angular
34
- * and AngularJS injectors without the need to actually bootstrap a hybrid application.
35
- * This makes it simpler and faster to unit test services.
36
- *
37
- * Use the returned class as an "import" when configuring the `TestBed`.
38
- *
39
- * In the following code snippet, we are configuring the TestBed with two imports.
40
- * The `Ng2AppModule` is the Angular part of our hybrid application and the `ng1AppModule` is the
41
- * AngularJS part.
42
- *
43
- * {@example upgrade/static/ts/full/module.spec.ts region='angular-setup'}
44
- *
45
- * Once this is done we can get hold of services via the Angular `Injector` as normal.
46
- * Services that are (or have dependencies on) an upgraded AngularJS service, will be instantiated
47
- * as needed by the AngularJS `$injector`.
48
- *
49
- * In the following code snippet, `HeroesService` is an Angular service that depends upon an
50
- * AngularJS service, `titleCase`.
51
- *
52
- * {@example upgrade/static/ts/full/module.spec.ts region='angular-spec'}
53
- *
54
- * <div class="docs-alert docs-alert-important">
55
- *
56
- * This helper is for testing services not Components.
57
- * For Component testing you must still bootstrap a hybrid app. See `UpgradeModule` or
58
- * `downgradeModule` for more information.
59
- *
60
- * </div>
61
- *
62
- * <div class="docs-alert docs-alert-important">
63
- *
64
- * The resulting configuration does not wire up AngularJS digests to Zone hooks. It is the
65
- * responsibility of the test writer to call `$rootScope.$apply`, as necessary, to trigger
66
- * AngularJS handlers of async events from Angular.
67
- *
68
- * </div>
69
- *
70
- * <div class="docs-alert docs-alert-important">
71
- *
72
- * The helper sets up global variables to hold the shared Angular and AngularJS injectors.
73
- *
74
- * * Only call this helper once per spec.
75
- * * Do not use `createAngularTestingModule` in the same spec as `createAngularJSTestingModule`.
76
- *
77
- * </div>
78
- *
79
- * Here is the example application and its unit tests that use `createAngularTestingModule`
80
- * and `createAngularJSTestingModule`.
81
- *
82
- * <code-tabs>
83
- * <code-pane header="module.spec.ts" path="upgrade/static/ts/full/module.spec.ts"></code-pane>
84
- * <code-pane header="module.ts" path="upgrade/static/ts/full/module.ts"></code-pane>
85
- * </code-tabs>
86
- *
87
- *
88
- * @param angularJSModules a collection of the names of AngularJS modules to include in the
89
- * configuration.
90
- * @param [strictDi] whether the AngularJS injector should have `strictDI` enabled.
91
- *
92
- * @publicApi
93
- */
48
+ i0.ɵɵngDeclareClassMetadata({
49
+ minVersion: "12.0.0",
50
+ version: "21.0.0-rc.0",
51
+ ngImport: i0,
52
+ type: AngularTestingModule,
53
+ decorators: [{
54
+ type: NgModule,
55
+ args: [{
56
+ providers: [{
57
+ provide: $INJECTOR,
58
+ useFactory: $injectorFactory
59
+ }]
60
+ }]
61
+ }],
62
+ ctorParameters: () => [{
63
+ type: i0.Injector
64
+ }]
65
+ });
94
66
  function createAngularTestingModule(angularJSModules, strictDi) {
95
- module_('$$angularJSTestingModule', angularJSModules)
96
- .constant(UPGRADE_APP_TYPE_KEY, 2 /* UpgradeAppType.Static */)
97
- .factory(INJECTOR_KEY, () => injector);
98
- $injector = injector$1(['ng', '$$angularJSTestingModule'], strictDi);
99
- return AngularTestingModule;
67
+ module_('$$angularJSTestingModule', angularJSModules).constant(UPGRADE_APP_TYPE_KEY, 2).factory(INJECTOR_KEY, () => injector);
68
+ $injector = injector$1(['ng', '$$angularJSTestingModule'], strictDi);
69
+ return AngularTestingModule;
100
70
  }
101
71
 
102
- /**
103
- * A helper function to use when unit testing AngularJS services that depend upon downgraded Angular
104
- * services.
105
- *
106
- * This function returns an AngularJS module that is configured to wire up the AngularJS and Angular
107
- * injectors without the need to actually bootstrap a hybrid application.
108
- * This makes it simpler and faster to unit test services.
109
- *
110
- * Use the returned AngularJS module in a call to
111
- * [`angular.mocks.module`](https://docs.angularjs.org/api/ngMock/function/angular.mock.module) to
112
- * include this module in the unit test injector.
113
- *
114
- * In the following code snippet, we are configuring the `$injector` with two modules:
115
- * The AngularJS `ng1AppModule`, which is the AngularJS part of our hybrid application and the
116
- * `Ng2AppModule`, which is the Angular part.
117
- *
118
- * {@example upgrade/static/ts/full/module.spec.ts region='angularjs-setup'}
119
- *
120
- * Once this is done we can get hold of services via the AngularJS `$injector` as normal.
121
- * Services that are (or have dependencies on) a downgraded Angular service, will be instantiated as
122
- * needed by the Angular root `Injector`.
123
- *
124
- * In the following code snippet, `heroesService` is a downgraded Angular service that we are
125
- * accessing from AngularJS.
126
- *
127
- * {@example upgrade/static/ts/full/module.spec.ts region='angularjs-spec'}
128
- *
129
- * <div class="docs-alert docs-alert-important">
130
- *
131
- * This helper is for testing services not components.
132
- * For Component testing you must still bootstrap a hybrid app. See `UpgradeModule` or
133
- * `downgradeModule` for more information.
134
- *
135
- * </div>
136
- *
137
- * <div class="docs-alert docs-alert-important">
138
- *
139
- * The resulting configuration does not wire up AngularJS digests to Zone hooks. It is the
140
- * responsibility of the test writer to call `$rootScope.$apply`, as necessary, to trigger
141
- * AngularJS handlers of async events from Angular.
142
- *
143
- * </div>
144
- *
145
- * <div class="docs-alert docs-alert-important">
146
- *
147
- * The helper sets up global variables to hold the shared Angular and AngularJS injectors.
148
- *
149
- * * Only call this helper once per spec.
150
- * * Do not use `createAngularJSTestingModule` in the same spec as `createAngularTestingModule`.
151
- *
152
- * </div>
153
- *
154
- * Here is the example application and its unit tests that use `createAngularTestingModule`
155
- * and `createAngularJSTestingModule`.
156
- *
157
- * <code-tabs>
158
- * <code-pane header="module.spec.ts" path="upgrade/static/ts/full/module.spec.ts"></code-pane>
159
- * <code-pane header="module.ts" path="upgrade/static/ts/full/module.ts"></code-pane>
160
- * </code-tabs>
161
- *
162
- *
163
- * @param angularModules a collection of Angular modules to include in the configuration.
164
- *
165
- * @publicApi
166
- */
167
72
  function createAngularJSTestingModule(angularModules) {
168
- return module_('$$angularJSTestingModule', [])
169
- .constant(UPGRADE_APP_TYPE_KEY, 2 /* UpgradeAppType.Static */)
170
- .factory(INJECTOR_KEY, [
171
- $INJECTOR,
172
- ($injector) => {
173
- TestBed.configureTestingModule({
174
- imports: angularModules,
175
- providers: [{ provide: $INJECTOR, useValue: $injector }],
176
- });
177
- return TestBed.inject(Injector);
178
- },
179
- ]).name;
73
+ return module_('$$angularJSTestingModule', []).constant(UPGRADE_APP_TYPE_KEY, 2).factory(INJECTOR_KEY, [$INJECTOR, $injector => {
74
+ TestBed.configureTestingModule({
75
+ imports: angularModules,
76
+ providers: [{
77
+ provide: $INJECTOR,
78
+ useValue: $injector
79
+ }]
80
+ });
81
+ return TestBed.inject(Injector);
82
+ }]).name;
180
83
  }
181
84
 
182
85
  export { createAngularJSTestingModule, createAngularTestingModule };
@@ -1 +1 @@
1
- {"version":3,"file":"static-testing.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/upgrade/static/testing/src/create_angular_testing_module.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/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 '../../../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 '../../../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.$INJECTOR","angular\n .module_","ɵconstants.UPGRADE_APP_TYPE_KEY","ɵconstants.INJECTOR_KEY","angular.injector","ng\n .module_"],"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,SAAoB,EAAE,UAAU,EAAE,gBAAgB,EAAC,CAAC,EAAA,CAAA;;sGACxE,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA,EAAC,SAAS,EAAE,CAAC,EAAC,OAAO,EAAEA,SAAoB,EAAE,UAAU,EAAE,gBAAgB,EAAC,CAAC,EAAC;;AAOtF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEG;AACa,SAAA,0BAA0B,CACxC,gBAA0B,EAC1B,QAAkB,EAAA;IAElBC,OACU,CAAC,0BAA0B,EAAE,gBAAgB;AACpD,SAAA,QAAQ,CAACC,oBAA+B,EAAwB,CAAA;SAChE,OAAO,CAACC,YAAuB,EAAE,MAAM,QAAQ,CAAC;AACnD,IAAA,SAAS,GAAGC,UAAgB,CAAC,CAAC,IAAI,EAAE,0BAA0B,CAAC,EAAE,QAAQ,CAAC;AAC1E,IAAA,OAAO,oBAAoB;AAC7B;;ACxFA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEG;AACG,SAAU,4BAA4B,CAAC,cAAqB,EAAA;AAChE,IAAA,OAAOC,OACG,CAAC,0BAA0B,EAAE,EAAE;AACtC,SAAA,QAAQ,CAACH,oBAA+B,EAAwB,CAAA;AAChE,SAAA,OAAO,CAACC,YAAuB,EAAE;AAChC,QAAAH,SAAoB;QACpB,CAAC,SAA8B,KAAI;YACjC,OAAO,CAAC,sBAAsB,CAAC;AAC7B,gBAAA,OAAO,EAAE,cAAc;AACvB,gBAAA,SAAS,EAAE,CAAC,EAAC,OAAO,EAAEA,SAAoB,EAAE,QAAQ,EAAE,SAAS,EAAC,CAAC;AAClE,aAAA,CAAC;AACF,YAAA,OAAO,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC;SAChC;KACF,CAAC,CAAC,IAAI;AACX;;;;"}
1
+ {"version":3,"file":"static-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/upgrade/static/testing/src/create_angular_testing_module.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/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 '../../../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 '../../../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":["$injector","AngularTestingModule","ɵɵngDeclareNgModule","minVersion","version","ngImport","i0","type","ɵinj","ɵɵngDeclareInjector","providers","provide","ɵconstants","useFactory","$injectorFactory","TestBed","configureTestingModule","imports","angularModules","useValue"],"mappings":";;;;;;;;;;;;;;AAiBE,EAAA,OAAAA,SAAA;AAIF;AACE,MAAAC,oBAAuB,CAAA;;;AADZ;;;;;;;;;;;kBADZ,CAAQC,mBAAA,CAAA;IAAAC,UAAA,EAAA,QAAA;IAAAC,OAAA,EAAA,mBAAA;AAAAC,IAAAA,QAAA,EAAAC,EAAA;AAAAC,IAAAA,IAAA,EAAAN;AAAA,GAAA,CAAA;AAAC,EAAA,OAAAO,IAAA,GAAAF,EAAA,CAAAG,mBAAA,CAAA;IAAAN,UAAA,EAAA,QAAA;IAAAC,OAAA,EAAA,mBAAA;AAAAC,IAAAA,QAAA,EAAAC,EAAA;AAAAC,IAAAA,IAAA,EAAAN,oBAAA;IAAAS,SAAA,EAAA,CAAA;MAAAC,OAAA,EAAAC,SAAA;AAAAC,MAAAA,UAAA,EAAAC;AAAA,KAAA;AAAA,GAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;AAiFR,EAAA,OAAAb,oBAAA;AACF;;;qHCbSD,SAAA,IAAA;AACDe,IAAAA,OAAA,CAAAC,sBAAA,CAAA;AACDC,MAAAA,OAAA,EAAAC,cAAA;MACIR,SAAA,EAAA,CAAA;QAAAC,OAAA,EAAAC,SAAA;AAAAO,QAAAA,QAAA,EAAAnB;AAAA,OAAA;AACX,KAAA,CAAA;;;;;;;"}