@angular/core 17.1.0-next.3 → 17.1.0-next.4
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.
- package/esm2022/primitives/signals/src/signal.mjs +2 -9
- package/esm2022/src/application/application_config.mjs +21 -0
- package/esm2022/src/application/application_init.mjs +188 -0
- package/esm2022/src/application/application_module.mjs +29 -0
- package/esm2022/src/application/application_ref.mjs +509 -0
- package/esm2022/src/application/application_tokens.mjs +121 -0
- package/esm2022/src/application/create_application.mjs +102 -0
- package/esm2022/src/authoring/input.mjs +41 -0
- package/esm2022/src/authoring/input_signal.mjs +10 -0
- package/esm2022/src/authoring/input_type_checking.mjs +9 -0
- package/esm2022/src/authoring.mjs +12 -0
- package/esm2022/src/change_detection/scheduling.mjs +103 -0
- package/esm2022/src/compiler/compiler_facade_interface.mjs +1 -1
- package/esm2022/src/core.mjs +15 -7
- package/esm2022/src/core_private_export.mjs +5 -3
- package/esm2022/src/core_reactivity_export_internal.mjs +2 -2
- package/esm2022/src/core_render3_private_export.mjs +2 -2
- package/esm2022/src/error_handler.mjs +15 -1
- package/esm2022/src/hydration/annotate.mjs +1 -1
- package/esm2022/src/hydration/api.mjs +2 -2
- package/esm2022/src/hydration/cleanup.mjs +1 -1
- package/esm2022/src/image_performance_warning.mjs +2 -2
- package/esm2022/src/linker/query_list.mjs +8 -6
- package/esm2022/src/metadata/do_bootstrap.mjs +1 -1
- package/esm2022/src/platform/platform.mjs +135 -0
- package/esm2022/src/platform/platform_core_providers.mjs +15 -0
- package/esm2022/src/platform/platform_ref.mjs +179 -0
- package/esm2022/src/render3/instructions/change_detection.mjs +2 -4
- package/esm2022/src/render3/interfaces/definition.mjs +1 -1
- package/esm2022/src/render3/interfaces/public_definitions.mjs +1 -1
- package/esm2022/src/render3/list_reconciliation.mjs +58 -24
- package/esm2022/src/render3/util/change_detection_utils.mjs +3 -1
- package/esm2022/src/render3/util/misc_utils.mjs +2 -2
- package/esm2022/src/render3/view_ref.mjs +7 -1
- package/esm2022/src/transfer_state.mjs +2 -2
- package/esm2022/src/util/performance.mjs +2 -2
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/src/zone/ng_zone.mjs +10 -1
- package/esm2022/testing/src/component_fixture.mjs +20 -36
- package/esm2022/testing/src/logger.mjs +3 -3
- package/esm2022/testing/src/test_bed.mjs +5 -6
- package/fesm2022/core.mjs +1343 -1271
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +2 -9
- package/fesm2022/primitives/signals.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +46 -64
- package/fesm2022/testing.mjs.map +1 -1
- package/index.d.ts +156 -21
- package/package.json +1 -1
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/migrations/block-template-entities/bundle.js +674 -500
- package/schematics/migrations/block-template-entities/bundle.js.map +3 -3
- package/schematics/migrations/compiler-options/bundle.js +13 -13
- package/schematics/migrations/transfer-state/bundle.js +13 -13
- package/schematics/ng-generate/control-flow-migration/bundle.js +830 -552
- package/schematics/ng-generate/control-flow-migration/bundle.js.map +3 -3
- package/schematics/ng-generate/standalone-migration/bundle.js +1958 -1532
- package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
- package/testing/index.d.ts +6 -10
- package/esm2022/src/application_config.mjs +0 -21
- package/esm2022/src/application_init.mjs +0 -188
- package/esm2022/src/application_module.mjs +0 -29
- package/esm2022/src/application_ref.mjs +0 -997
- package/esm2022/src/application_tokens.mjs +0 -121
- package/esm2022/src/platform_core_providers.mjs +0 -15
package/fesm2022/core.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v17.1.0-next.
|
|
2
|
+
* @license Angular v17.1.0-next.4
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -8,6 +8,45 @@ import { setActiveConsumer as setActiveConsumer$1, consumerDestroy as consumerDe
|
|
|
8
8
|
import { Subject, Subscription, Observable, merge as merge$1, BehaviorSubject, of } from 'rxjs';
|
|
9
9
|
import { share, switchMap, distinctUntilChanged, first } from 'rxjs/operators';
|
|
10
10
|
|
|
11
|
+
function inputFunction(_initialValue, _opts) {
|
|
12
|
+
throw new Error('TODO');
|
|
13
|
+
}
|
|
14
|
+
function inputRequiredFunction(_opts) {
|
|
15
|
+
throw new Error('TODO');
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Initializes an input with an initial value. If no explicit value
|
|
19
|
+
* is specified, Angular will use `undefined`.
|
|
20
|
+
*
|
|
21
|
+
* Consider using `input.required` for inputs that don't need an
|
|
22
|
+
* initial value.
|
|
23
|
+
*
|
|
24
|
+
* @usageNotes
|
|
25
|
+
* Initialize an input in your directive or component by declaring a
|
|
26
|
+
* class field and initializing it with the `input()` function.
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* @Directive({..})
|
|
30
|
+
* export class MyDir {
|
|
31
|
+
* firstName = input<string>(); // string|undefined
|
|
32
|
+
* lastName = input.required<string>(); // string
|
|
33
|
+
* age = input(0); // number
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
const input = (() => {
|
|
38
|
+
// Note: This may be considered a side-effect, but nothing will depend on
|
|
39
|
+
// this assignment, unless this `input` constant export is accessed. It's a
|
|
40
|
+
// self-contained side effect that is local to the user facing`input` export.
|
|
41
|
+
inputFunction.required = inputRequiredFunction;
|
|
42
|
+
return inputFunction;
|
|
43
|
+
})();
|
|
44
|
+
|
|
45
|
+
const ɵINPUT_SIGNAL_BRAND_READ_TYPE = /* @__PURE__ */ Symbol();
|
|
46
|
+
const ɵINPUT_SIGNAL_BRAND_WRITE_TYPE = /* @__PURE__ */ Symbol();
|
|
47
|
+
|
|
48
|
+
// Note: `input` is exported in `core.ts` due to:
|
|
49
|
+
|
|
11
50
|
function getClosureSafeProperty(objWithPropertyToExtract) {
|
|
12
51
|
for (let key in objWithPropertyToExtract) {
|
|
13
52
|
if (objWithPropertyToExtract[key] === getClosureSafeProperty) {
|
|
@@ -10427,7 +10466,7 @@ class Version {
|
|
|
10427
10466
|
/**
|
|
10428
10467
|
* @publicApi
|
|
10429
10468
|
*/
|
|
10430
|
-
const VERSION = new Version('17.1.0-next.
|
|
10469
|
+
const VERSION = new Version('17.1.0-next.4');
|
|
10431
10470
|
|
|
10432
10471
|
// This default value is when checking the hierarchy for a token.
|
|
10433
10472
|
//
|
|
@@ -11762,6 +11801,19 @@ class ErrorHandler {
|
|
|
11762
11801
|
return e || null;
|
|
11763
11802
|
}
|
|
11764
11803
|
}
|
|
11804
|
+
/**
|
|
11805
|
+
* `InjectionToken` used to configure how to call the `ErrorHandler`.
|
|
11806
|
+
*
|
|
11807
|
+
* `NgZone` is provided by default today so the default (and only) implementation for this
|
|
11808
|
+
* is calling `ErrorHandler.handleError` outside of the Angular zone.
|
|
11809
|
+
*/
|
|
11810
|
+
const INTERNAL_APPLICATION_ERROR_HANDLER = new InjectionToken((typeof ngDevMode === 'undefined' || ngDevMode) ? 'internal error handler' : '', {
|
|
11811
|
+
providedIn: 'root',
|
|
11812
|
+
factory: () => {
|
|
11813
|
+
const userErrorHandler = inject(ErrorHandler);
|
|
11814
|
+
return userErrorHandler.handleError.bind(undefined);
|
|
11815
|
+
}
|
|
11816
|
+
});
|
|
11765
11817
|
|
|
11766
11818
|
/**
|
|
11767
11819
|
* Internal token that specifies whether DOM reuse logic
|
|
@@ -13306,9 +13358,6 @@ function detectChangesInternal(lView, notifyErrorHandler = true) {
|
|
|
13306
13358
|
afterRenderEventManager?.begin();
|
|
13307
13359
|
}
|
|
13308
13360
|
try {
|
|
13309
|
-
const tView = lView[TVIEW];
|
|
13310
|
-
const context = lView[CONTEXT];
|
|
13311
|
-
refreshView(tView, lView, tView.template, context);
|
|
13312
13361
|
detectChangesInViewWhileDirty(lView);
|
|
13313
13362
|
}
|
|
13314
13363
|
catch (error) {
|
|
@@ -13329,6 +13378,7 @@ function detectChangesInternal(lView, notifyErrorHandler = true) {
|
|
|
13329
13378
|
}
|
|
13330
13379
|
}
|
|
13331
13380
|
function detectChangesInViewWhileDirty(lView) {
|
|
13381
|
+
detectChangesInView(lView, 0 /* ChangeDetectionMode.Global */);
|
|
13332
13382
|
let retries = 0;
|
|
13333
13383
|
// If after running change detection, this view still needs to be refreshed or there are
|
|
13334
13384
|
// descendants views that need to be refreshed due to re-dirtying during the change detection
|
|
@@ -13900,6 +13950,12 @@ class ViewRef$1 {
|
|
|
13900
13950
|
* See {@link ChangeDetectorRef#detach} for more information.
|
|
13901
13951
|
*/
|
|
13902
13952
|
detectChanges() {
|
|
13953
|
+
// Add `RefreshView` flag to ensure this view is refreshed if not already dirty.
|
|
13954
|
+
// `RefreshView` flag is used intentionally over `Dirty` because it gets cleared before
|
|
13955
|
+
// executing any of the actual refresh code while the `Dirty` flag doesn't get cleared
|
|
13956
|
+
// until the end of the refresh. Using `RefreshView` prevents creating a potential difference
|
|
13957
|
+
// in the state of the LViewFlags during template execution.
|
|
13958
|
+
this._lView[FLAGS] |= 1024 /* LViewFlags.RefreshView */;
|
|
13903
13959
|
detectChangesInternal(this._lView, this.notifyErrorHandler);
|
|
13904
13960
|
}
|
|
13905
13961
|
/**
|
|
@@ -14269,7 +14325,7 @@ function performanceMarkFeature(feature) {
|
|
|
14269
14325
|
return;
|
|
14270
14326
|
}
|
|
14271
14327
|
markedFeatures.add(feature);
|
|
14272
|
-
performance?.mark?.('
|
|
14328
|
+
performance?.mark?.('mark_feature_usage', { detail: { feature } });
|
|
14273
14329
|
}
|
|
14274
14330
|
|
|
14275
14331
|
/// <reference types="rxjs" />
|
|
@@ -14840,6 +14896,15 @@ function shouldBeIgnoredByZone(applyArgs) {
|
|
|
14840
14896
|
// Prevent triggering change detection when the __ignore_ng_zone__ flag is detected.
|
|
14841
14897
|
return applyArgs[0].data?.['__ignore_ng_zone__'] === true;
|
|
14842
14898
|
}
|
|
14899
|
+
function getNgZone(ngZoneToUse = 'zone.js', options) {
|
|
14900
|
+
if (ngZoneToUse === 'noop') {
|
|
14901
|
+
return new NoopNgZone();
|
|
14902
|
+
}
|
|
14903
|
+
if (ngZoneToUse === 'zone.js') {
|
|
14904
|
+
return new NgZone(options);
|
|
14905
|
+
}
|
|
14906
|
+
return ngZoneToUse;
|
|
14907
|
+
}
|
|
14843
14908
|
|
|
14844
14909
|
// Public API for Zone
|
|
14845
14910
|
|
|
@@ -19586,7 +19651,7 @@ function reconcile(liveCollection, newCollection, trackByFn) {
|
|
|
19586
19651
|
}
|
|
19587
19652
|
// Fallback to the slow path: we need to learn more about the content of the live and new
|
|
19588
19653
|
// collections.
|
|
19589
|
-
detachedItems ??= new
|
|
19654
|
+
detachedItems ??= new UniqueValueMultiKeyMap();
|
|
19590
19655
|
liveKeysInTheFuture ??=
|
|
19591
19656
|
initLiveItemsInTheFuture(liveCollection, liveStartIdx, liveEndIdx, trackByFn);
|
|
19592
19657
|
// Check if I'm inserting a previously detached item: if so, attach it here
|
|
@@ -19634,7 +19699,7 @@ function reconcile(liveCollection, newCollection, trackByFn) {
|
|
|
19634
19699
|
newIterationResult = newCollectionIterator.next();
|
|
19635
19700
|
}
|
|
19636
19701
|
else {
|
|
19637
|
-
detachedItems ??= new
|
|
19702
|
+
detachedItems ??= new UniqueValueMultiKeyMap();
|
|
19638
19703
|
liveKeysInTheFuture ??=
|
|
19639
19704
|
initLiveItemsInTheFuture(liveCollection, liveStartIdx, liveEndIdx, trackByFn);
|
|
19640
19705
|
// Check if I'm inserting a previously detached item: if so, attach it here
|
|
@@ -19700,40 +19765,73 @@ function initLiveItemsInTheFuture(liveCollection, start, end, trackByFn) {
|
|
|
19700
19765
|
}
|
|
19701
19766
|
return keys;
|
|
19702
19767
|
}
|
|
19703
|
-
|
|
19768
|
+
/**
|
|
19769
|
+
* A specific, partial implementation of the Map interface with the following characteristics:
|
|
19770
|
+
* - allows multiple values for a given key;
|
|
19771
|
+
* - maintain FIFO order for multiple values corresponding to a given key;
|
|
19772
|
+
* - assumes that all values are unique.
|
|
19773
|
+
*
|
|
19774
|
+
* The implementation aims at having the minimal overhead for cases where keys are _not_ duplicated
|
|
19775
|
+
* (the most common case in the list reconciliation algorithm). To achieve this, the first value for
|
|
19776
|
+
* a given key is stored in a regular map. Then, when more values are set for a given key, we
|
|
19777
|
+
* maintain a form of linked list in a separate map. To maintain this linked list we assume that all
|
|
19778
|
+
* values (in the entire collection) are unique.
|
|
19779
|
+
*/
|
|
19780
|
+
class UniqueValueMultiKeyMap {
|
|
19704
19781
|
constructor() {
|
|
19705
|
-
|
|
19782
|
+
// A map from a key to the first value corresponding to this key.
|
|
19783
|
+
this.kvMap = new Map();
|
|
19784
|
+
// A map that acts as a linked list of values - each value maps to the next value in this "linked
|
|
19785
|
+
// list" (this only works if values are unique). Allocated lazily to avoid memory consumption when
|
|
19786
|
+
// there are no duplicated values.
|
|
19787
|
+
this._vMap = undefined;
|
|
19706
19788
|
}
|
|
19707
19789
|
has(key) {
|
|
19708
|
-
|
|
19709
|
-
return listOfKeys !== undefined && listOfKeys.length > 0;
|
|
19790
|
+
return this.kvMap.has(key);
|
|
19710
19791
|
}
|
|
19711
19792
|
delete(key) {
|
|
19712
|
-
|
|
19713
|
-
|
|
19714
|
-
|
|
19715
|
-
|
|
19793
|
+
if (!this.has(key))
|
|
19794
|
+
return false;
|
|
19795
|
+
const value = this.kvMap.get(key);
|
|
19796
|
+
if (this._vMap !== undefined && this._vMap.has(value)) {
|
|
19797
|
+
this.kvMap.set(key, this._vMap.get(value));
|
|
19798
|
+
this._vMap.delete(value);
|
|
19716
19799
|
}
|
|
19717
|
-
|
|
19800
|
+
else {
|
|
19801
|
+
this.kvMap.delete(key);
|
|
19802
|
+
}
|
|
19803
|
+
return true;
|
|
19718
19804
|
}
|
|
19719
19805
|
get(key) {
|
|
19720
|
-
|
|
19721
|
-
return listOfKeys !== undefined && listOfKeys.length > 0 ? listOfKeys[0] : undefined;
|
|
19806
|
+
return this.kvMap.get(key);
|
|
19722
19807
|
}
|
|
19723
19808
|
set(key, value) {
|
|
19724
|
-
|
|
19725
|
-
|
|
19726
|
-
|
|
19727
|
-
|
|
19809
|
+
if (this.kvMap.has(key)) {
|
|
19810
|
+
let prevValue = this.kvMap.get(key);
|
|
19811
|
+
ngDevMode &&
|
|
19812
|
+
assertNotSame(prevValue, value, `Detected a duplicated value ${value} for the key ${key}`);
|
|
19813
|
+
if (this._vMap === undefined) {
|
|
19814
|
+
this._vMap = new Map();
|
|
19815
|
+
}
|
|
19816
|
+
const vMap = this._vMap;
|
|
19817
|
+
while (vMap.has(prevValue)) {
|
|
19818
|
+
prevValue = vMap.get(prevValue);
|
|
19819
|
+
}
|
|
19820
|
+
vMap.set(prevValue, value);
|
|
19821
|
+
}
|
|
19822
|
+
else {
|
|
19823
|
+
this.kvMap.set(key, value);
|
|
19728
19824
|
}
|
|
19729
|
-
// THINK: this allows duplicate values, but I guess this is fine?
|
|
19730
|
-
// Is the existing key an array or not?
|
|
19731
|
-
this.map.get(key)?.push(value);
|
|
19732
19825
|
}
|
|
19733
19826
|
forEach(cb) {
|
|
19734
|
-
for (
|
|
19735
|
-
|
|
19736
|
-
|
|
19827
|
+
for (let [key, value] of this.kvMap) {
|
|
19828
|
+
cb(value, key);
|
|
19829
|
+
if (this._vMap !== undefined) {
|
|
19830
|
+
const vMap = this._vMap;
|
|
19831
|
+
while (vMap.has(value)) {
|
|
19832
|
+
value = vMap.get(value);
|
|
19833
|
+
cb(value, key);
|
|
19834
|
+
}
|
|
19737
19835
|
}
|
|
19738
19836
|
}
|
|
19739
19837
|
}
|
|
@@ -27875,7 +27973,7 @@ class QueryList {
|
|
|
27875
27973
|
* Returns `Observable` of `QueryList` notifying the subscriber of changes.
|
|
27876
27974
|
*/
|
|
27877
27975
|
get changes() {
|
|
27878
|
-
return this._changes
|
|
27976
|
+
return this._changes ??= new EventEmitter();
|
|
27879
27977
|
}
|
|
27880
27978
|
/**
|
|
27881
27979
|
* @param emitDistinctChangesOnly Whether `QueryList.changes` should fire only when actual change
|
|
@@ -27887,7 +27985,7 @@ class QueryList {
|
|
|
27887
27985
|
this.dirty = true;
|
|
27888
27986
|
this._results = [];
|
|
27889
27987
|
this._changesDetected = false;
|
|
27890
|
-
this._changes =
|
|
27988
|
+
this._changes = undefined;
|
|
27891
27989
|
this.length = 0;
|
|
27892
27990
|
this.first = undefined;
|
|
27893
27991
|
this.last = undefined;
|
|
@@ -27978,7 +28076,7 @@ class QueryList {
|
|
|
27978
28076
|
* Triggers a change event by emitting on the `changes` {@link EventEmitter}.
|
|
27979
28077
|
*/
|
|
27980
28078
|
notifyOnChanges() {
|
|
27981
|
-
if (this._changes && (this._changesDetected || !this._emitDistinctChangesOnly))
|
|
28079
|
+
if (this._changes !== undefined && (this._changesDetected || !this._emitDistinctChangesOnly))
|
|
27982
28080
|
this._changes.emit(this);
|
|
27983
28081
|
}
|
|
27984
28082
|
/** internal */
|
|
@@ -27987,8 +28085,10 @@ class QueryList {
|
|
|
27987
28085
|
}
|
|
27988
28086
|
/** internal */
|
|
27989
28087
|
destroy() {
|
|
27990
|
-
this.
|
|
27991
|
-
|
|
28088
|
+
if (this._changes !== undefined) {
|
|
28089
|
+
this._changes.complete();
|
|
28090
|
+
this._changes.unsubscribe();
|
|
28091
|
+
}
|
|
27992
28092
|
}
|
|
27993
28093
|
}
|
|
27994
28094
|
|
|
@@ -29928,190 +30028,6 @@ const NgModule = makeDecorator('NgModule', (ngModule) => ngModule, undefined, un
|
|
|
29928
30028
|
*/
|
|
29929
30029
|
const ITS_JUST_ANGULAR = true;
|
|
29930
30030
|
|
|
29931
|
-
/**
|
|
29932
|
-
* A [DI token](guide/glossary#di-token "DI token definition") that you can use to provide
|
|
29933
|
-
* one or more initialization functions.
|
|
29934
|
-
*
|
|
29935
|
-
* The provided functions are injected at application startup and executed during
|
|
29936
|
-
* app initialization. If any of these functions returns a Promise or an Observable, initialization
|
|
29937
|
-
* does not complete until the Promise is resolved or the Observable is completed.
|
|
29938
|
-
*
|
|
29939
|
-
* You can, for example, create a factory function that loads language data
|
|
29940
|
-
* or an external configuration, and provide that function to the `APP_INITIALIZER` token.
|
|
29941
|
-
* The function is executed during the application bootstrap process,
|
|
29942
|
-
* and the needed data is available on startup.
|
|
29943
|
-
*
|
|
29944
|
-
* @see {@link ApplicationInitStatus}
|
|
29945
|
-
*
|
|
29946
|
-
* @usageNotes
|
|
29947
|
-
*
|
|
29948
|
-
* The following example illustrates how to configure a multi-provider using `APP_INITIALIZER` token
|
|
29949
|
-
* and a function returning a promise.
|
|
29950
|
-
* ### Example with NgModule-based application
|
|
29951
|
-
* ```
|
|
29952
|
-
* function initializeApp(): Promise<any> {
|
|
29953
|
-
* return new Promise((resolve, reject) => {
|
|
29954
|
-
* // Do some asynchronous stuff
|
|
29955
|
-
* resolve();
|
|
29956
|
-
* });
|
|
29957
|
-
* }
|
|
29958
|
-
*
|
|
29959
|
-
* @NgModule({
|
|
29960
|
-
* imports: [BrowserModule],
|
|
29961
|
-
* declarations: [AppComponent],
|
|
29962
|
-
* bootstrap: [AppComponent],
|
|
29963
|
-
* providers: [{
|
|
29964
|
-
* provide: APP_INITIALIZER,
|
|
29965
|
-
* useFactory: () => initializeApp,
|
|
29966
|
-
* multi: true
|
|
29967
|
-
* }]
|
|
29968
|
-
* })
|
|
29969
|
-
* export class AppModule {}
|
|
29970
|
-
* ```
|
|
29971
|
-
*
|
|
29972
|
-
* ### Example with standalone application
|
|
29973
|
-
* ```
|
|
29974
|
-
* export function initializeApp(http: HttpClient) {
|
|
29975
|
-
* return (): Promise<any> =>
|
|
29976
|
-
* firstValueFrom(
|
|
29977
|
-
* http
|
|
29978
|
-
* .get("https://someUrl.com/api/user")
|
|
29979
|
-
* .pipe(tap(user => { ... }))
|
|
29980
|
-
* );
|
|
29981
|
-
* }
|
|
29982
|
-
*
|
|
29983
|
-
* bootstrapApplication(App, {
|
|
29984
|
-
* providers: [
|
|
29985
|
-
* provideHttpClient(),
|
|
29986
|
-
* {
|
|
29987
|
-
* provide: APP_INITIALIZER,
|
|
29988
|
-
* useFactory: initializeApp,
|
|
29989
|
-
* multi: true,
|
|
29990
|
-
* deps: [HttpClient],
|
|
29991
|
-
* },
|
|
29992
|
-
* ],
|
|
29993
|
-
* });
|
|
29994
|
-
|
|
29995
|
-
* ```
|
|
29996
|
-
*
|
|
29997
|
-
*
|
|
29998
|
-
* It's also possible to configure a multi-provider using `APP_INITIALIZER` token and a function
|
|
29999
|
-
* returning an observable, see an example below. Note: the `HttpClient` in this example is used for
|
|
30000
|
-
* demo purposes to illustrate how the factory function can work with other providers available
|
|
30001
|
-
* through DI.
|
|
30002
|
-
*
|
|
30003
|
-
* ### Example with NgModule-based application
|
|
30004
|
-
* ```
|
|
30005
|
-
* function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
|
|
30006
|
-
* return () => httpClient.get("https://someUrl.com/api/user")
|
|
30007
|
-
* .pipe(
|
|
30008
|
-
* tap(user => { ... })
|
|
30009
|
-
* );
|
|
30010
|
-
* }
|
|
30011
|
-
*
|
|
30012
|
-
* @NgModule({
|
|
30013
|
-
* imports: [BrowserModule, HttpClientModule],
|
|
30014
|
-
* declarations: [AppComponent],
|
|
30015
|
-
* bootstrap: [AppComponent],
|
|
30016
|
-
* providers: [{
|
|
30017
|
-
* provide: APP_INITIALIZER,
|
|
30018
|
-
* useFactory: initializeAppFactory,
|
|
30019
|
-
* deps: [HttpClient],
|
|
30020
|
-
* multi: true
|
|
30021
|
-
* }]
|
|
30022
|
-
* })
|
|
30023
|
-
* export class AppModule {}
|
|
30024
|
-
* ```
|
|
30025
|
-
*
|
|
30026
|
-
* ### Example with standalone application
|
|
30027
|
-
* ```
|
|
30028
|
-
* function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
|
|
30029
|
-
* return () => httpClient.get("https://someUrl.com/api/user")
|
|
30030
|
-
* .pipe(
|
|
30031
|
-
* tap(user => { ... })
|
|
30032
|
-
* );
|
|
30033
|
-
* }
|
|
30034
|
-
*
|
|
30035
|
-
* bootstrapApplication(App, {
|
|
30036
|
-
* providers: [
|
|
30037
|
-
* provideHttpClient(),
|
|
30038
|
-
* {
|
|
30039
|
-
* provide: APP_INITIALIZER,
|
|
30040
|
-
* useFactory: initializeAppFactory,
|
|
30041
|
-
* multi: true,
|
|
30042
|
-
* deps: [HttpClient],
|
|
30043
|
-
* },
|
|
30044
|
-
* ],
|
|
30045
|
-
* });
|
|
30046
|
-
* ```
|
|
30047
|
-
*
|
|
30048
|
-
* @publicApi
|
|
30049
|
-
*/
|
|
30050
|
-
const APP_INITIALIZER = new InjectionToken('Application Initializer');
|
|
30051
|
-
/**
|
|
30052
|
-
* A class that reflects the state of running {@link APP_INITIALIZER} functions.
|
|
30053
|
-
*
|
|
30054
|
-
* @publicApi
|
|
30055
|
-
*/
|
|
30056
|
-
class ApplicationInitStatus {
|
|
30057
|
-
constructor() {
|
|
30058
|
-
this.initialized = false;
|
|
30059
|
-
this.done = false;
|
|
30060
|
-
this.donePromise = new Promise((res, rej) => {
|
|
30061
|
-
this.resolve = res;
|
|
30062
|
-
this.reject = rej;
|
|
30063
|
-
});
|
|
30064
|
-
this.appInits = inject(APP_INITIALIZER, { optional: true }) ?? [];
|
|
30065
|
-
if ((typeof ngDevMode === 'undefined' || ngDevMode) && !Array.isArray(this.appInits)) {
|
|
30066
|
-
throw new RuntimeError(-209 /* RuntimeErrorCode.INVALID_MULTI_PROVIDER */, 'Unexpected type of the `APP_INITIALIZER` token value ' +
|
|
30067
|
-
`(expected an array, but got ${typeof this.appInits}). ` +
|
|
30068
|
-
'Please check that the `APP_INITIALIZER` token is configured as a ' +
|
|
30069
|
-
'`multi: true` provider.');
|
|
30070
|
-
}
|
|
30071
|
-
}
|
|
30072
|
-
/** @internal */
|
|
30073
|
-
runInitializers() {
|
|
30074
|
-
if (this.initialized) {
|
|
30075
|
-
return;
|
|
30076
|
-
}
|
|
30077
|
-
const asyncInitPromises = [];
|
|
30078
|
-
for (const appInits of this.appInits) {
|
|
30079
|
-
const initResult = appInits();
|
|
30080
|
-
if (isPromise(initResult)) {
|
|
30081
|
-
asyncInitPromises.push(initResult);
|
|
30082
|
-
}
|
|
30083
|
-
else if (isSubscribable(initResult)) {
|
|
30084
|
-
const observableAsPromise = new Promise((resolve, reject) => {
|
|
30085
|
-
initResult.subscribe({ complete: resolve, error: reject });
|
|
30086
|
-
});
|
|
30087
|
-
asyncInitPromises.push(observableAsPromise);
|
|
30088
|
-
}
|
|
30089
|
-
}
|
|
30090
|
-
const complete = () => {
|
|
30091
|
-
// @ts-expect-error overwriting a readonly
|
|
30092
|
-
this.done = true;
|
|
30093
|
-
this.resolve();
|
|
30094
|
-
};
|
|
30095
|
-
Promise.all(asyncInitPromises)
|
|
30096
|
-
.then(() => {
|
|
30097
|
-
complete();
|
|
30098
|
-
})
|
|
30099
|
-
.catch(e => {
|
|
30100
|
-
this.reject(e);
|
|
30101
|
-
});
|
|
30102
|
-
if (asyncInitPromises.length === 0) {
|
|
30103
|
-
complete();
|
|
30104
|
-
}
|
|
30105
|
-
this.initialized = true;
|
|
30106
|
-
}
|
|
30107
|
-
static { this.ɵfac = function ApplicationInitStatus_Factory(t) { return new (t || ApplicationInitStatus)(); }; }
|
|
30108
|
-
static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationInitStatus, factory: ApplicationInitStatus.ɵfac, providedIn: 'root' }); }
|
|
30109
|
-
}
|
|
30110
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationInitStatus, [{
|
|
30111
|
-
type: Injectable,
|
|
30112
|
-
args: [{ providedIn: 'root' }]
|
|
30113
|
-
}], () => [], null); })();
|
|
30114
|
-
|
|
30115
30031
|
class Console {
|
|
30116
30032
|
log(message) {
|
|
30117
30033
|
// tslint:disable-next-line:no-console
|
|
@@ -30131,563 +30047,234 @@ class Console {
|
|
|
30131
30047
|
}], null, null); })();
|
|
30132
30048
|
|
|
30133
30049
|
/**
|
|
30134
|
-
*
|
|
30050
|
+
* *Internal* service that keeps track of pending tasks happening in the system
|
|
30051
|
+
* during the initial rendering. No tasks are tracked after an initial
|
|
30052
|
+
* rendering.
|
|
30135
30053
|
*
|
|
30136
|
-
*
|
|
30137
|
-
*
|
|
30054
|
+
* This information is needed to make sure that the serialization on the server
|
|
30055
|
+
* is delayed until all tasks in the queue (such as an initial navigation or a
|
|
30056
|
+
* pending HTTP request) are completed.
|
|
30138
30057
|
*/
|
|
30139
|
-
|
|
30140
|
-
|
|
30141
|
-
|
|
30142
|
-
|
|
30143
|
-
|
|
30144
|
-
// Closure Compiler's one.
|
|
30145
|
-
return goog.LOCALE;
|
|
30058
|
+
class InitialRenderPendingTasks {
|
|
30059
|
+
constructor() {
|
|
30060
|
+
this.taskId = 0;
|
|
30061
|
+
this.pendingTasks = new Set();
|
|
30062
|
+
this.hasPendingTasks = new BehaviorSubject(false);
|
|
30146
30063
|
}
|
|
30147
|
-
|
|
30148
|
-
|
|
30149
|
-
|
|
30150
|
-
|
|
30151
|
-
|
|
30152
|
-
|
|
30153
|
-
|
|
30154
|
-
|
|
30155
|
-
|
|
30156
|
-
|
|
30157
|
-
|
|
30064
|
+
add() {
|
|
30065
|
+
this.hasPendingTasks.next(true);
|
|
30066
|
+
const taskId = this.taskId++;
|
|
30067
|
+
this.pendingTasks.add(taskId);
|
|
30068
|
+
return taskId;
|
|
30069
|
+
}
|
|
30070
|
+
remove(taskId) {
|
|
30071
|
+
this.pendingTasks.delete(taskId);
|
|
30072
|
+
if (this.pendingTasks.size === 0) {
|
|
30073
|
+
this.hasPendingTasks.next(false);
|
|
30074
|
+
}
|
|
30075
|
+
}
|
|
30076
|
+
ngOnDestroy() {
|
|
30077
|
+
this.pendingTasks.clear();
|
|
30078
|
+
this.hasPendingTasks.next(false);
|
|
30158
30079
|
}
|
|
30080
|
+
static { this.ɵfac = function InitialRenderPendingTasks_Factory(t) { return new (t || InitialRenderPendingTasks)(); }; }
|
|
30081
|
+
static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: InitialRenderPendingTasks, factory: InitialRenderPendingTasks.ɵfac, providedIn: 'root' }); }
|
|
30159
30082
|
}
|
|
30083
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(InitialRenderPendingTasks, [{
|
|
30084
|
+
type: Injectable,
|
|
30085
|
+
args: [{ providedIn: 'root' }]
|
|
30086
|
+
}], null, null); })();
|
|
30087
|
+
|
|
30160
30088
|
/**
|
|
30161
|
-
*
|
|
30162
|
-
* It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,
|
|
30163
|
-
* DecimalPipe and PercentPipe) and by ICU expressions.
|
|
30164
|
-
*
|
|
30165
|
-
* See the [i18n guide](guide/i18n-common-locale-id) for more information.
|
|
30089
|
+
* Combination of NgModuleFactory and ComponentFactories.
|
|
30166
30090
|
*
|
|
30167
|
-
* @
|
|
30168
|
-
* ### Example
|
|
30091
|
+
* @publicApi
|
|
30169
30092
|
*
|
|
30170
|
-
*
|
|
30171
|
-
*
|
|
30172
|
-
*
|
|
30173
|
-
*
|
|
30093
|
+
* @deprecated
|
|
30094
|
+
* Ivy JIT mode doesn't require accessing this symbol.
|
|
30095
|
+
* See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
|
|
30096
|
+
* additional context.
|
|
30097
|
+
*/
|
|
30098
|
+
class ModuleWithComponentFactories {
|
|
30099
|
+
constructor(ngModuleFactory, componentFactories) {
|
|
30100
|
+
this.ngModuleFactory = ngModuleFactory;
|
|
30101
|
+
this.componentFactories = componentFactories;
|
|
30102
|
+
}
|
|
30103
|
+
}
|
|
30104
|
+
/**
|
|
30105
|
+
* Low-level service for running the angular compiler during runtime
|
|
30106
|
+
* to create {@link ComponentFactory}s, which
|
|
30107
|
+
* can later be used to create and render a Component instance.
|
|
30174
30108
|
*
|
|
30175
|
-
*
|
|
30176
|
-
*
|
|
30177
|
-
*
|
|
30178
|
-
* ```
|
|
30109
|
+
* Each `@NgModule` provides an own `Compiler` to its injector,
|
|
30110
|
+
* that will use the directives/pipes of the ng module for compilation
|
|
30111
|
+
* of components.
|
|
30179
30112
|
*
|
|
30180
30113
|
* @publicApi
|
|
30114
|
+
*
|
|
30115
|
+
* @deprecated
|
|
30116
|
+
* Ivy JIT mode doesn't require accessing this symbol.
|
|
30117
|
+
* See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
|
|
30118
|
+
* additional context.
|
|
30181
30119
|
*/
|
|
30182
|
-
|
|
30183
|
-
|
|
30184
|
-
|
|
30185
|
-
|
|
30120
|
+
class Compiler {
|
|
30121
|
+
/**
|
|
30122
|
+
* Compiles the given NgModule and all of its components. All templates of the components
|
|
30123
|
+
* have to be inlined.
|
|
30124
|
+
*/
|
|
30125
|
+
compileModuleSync(moduleType) {
|
|
30126
|
+
return new NgModuleFactory(moduleType);
|
|
30127
|
+
}
|
|
30128
|
+
/**
|
|
30129
|
+
* Compiles the given NgModule and all of its components
|
|
30130
|
+
*/
|
|
30131
|
+
compileModuleAsync(moduleType) {
|
|
30132
|
+
return Promise.resolve(this.compileModuleSync(moduleType));
|
|
30133
|
+
}
|
|
30134
|
+
/**
|
|
30135
|
+
* Same as {@link #compileModuleSync} but also creates ComponentFactories for all components.
|
|
30136
|
+
*/
|
|
30137
|
+
compileModuleAndAllComponentsSync(moduleType) {
|
|
30138
|
+
const ngModuleFactory = this.compileModuleSync(moduleType);
|
|
30139
|
+
const moduleDef = getNgModuleDef(moduleType);
|
|
30140
|
+
const componentFactories = maybeUnwrapFn(moduleDef.declarations)
|
|
30141
|
+
.reduce((factories, declaration) => {
|
|
30142
|
+
const componentDef = getComponentDef(declaration);
|
|
30143
|
+
componentDef && factories.push(new ComponentFactory(componentDef));
|
|
30144
|
+
return factories;
|
|
30145
|
+
}, []);
|
|
30146
|
+
return new ModuleWithComponentFactories(ngModuleFactory, componentFactories);
|
|
30147
|
+
}
|
|
30148
|
+
/**
|
|
30149
|
+
* Same as {@link #compileModuleAsync} but also creates ComponentFactories for all components.
|
|
30150
|
+
*/
|
|
30151
|
+
compileModuleAndAllComponentsAsync(moduleType) {
|
|
30152
|
+
return Promise.resolve(this.compileModuleAndAllComponentsSync(moduleType));
|
|
30153
|
+
}
|
|
30154
|
+
/**
|
|
30155
|
+
* Clears all caches.
|
|
30156
|
+
*/
|
|
30157
|
+
clearCache() { }
|
|
30158
|
+
/**
|
|
30159
|
+
* Clears the cache for the given component/ngModule.
|
|
30160
|
+
*/
|
|
30161
|
+
clearCacheFor(type) { }
|
|
30162
|
+
/**
|
|
30163
|
+
* Returns the id for a given NgModule, if one is defined and known to the compiler.
|
|
30164
|
+
*/
|
|
30165
|
+
getModuleId(moduleType) {
|
|
30166
|
+
return undefined;
|
|
30167
|
+
}
|
|
30168
|
+
static { this.ɵfac = function Compiler_Factory(t) { return new (t || Compiler)(); }; }
|
|
30169
|
+
static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Compiler, factory: Compiler.ɵfac, providedIn: 'root' }); }
|
|
30170
|
+
}
|
|
30171
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Compiler, [{
|
|
30172
|
+
type: Injectable,
|
|
30173
|
+
args: [{ providedIn: 'root' }]
|
|
30174
|
+
}], null, null); })();
|
|
30186
30175
|
/**
|
|
30187
|
-
*
|
|
30188
|
-
* CurrencyPipe when there is no currency code passed into it. This is only used by
|
|
30189
|
-
* CurrencyPipe and has no relation to locale currency. Defaults to USD if not configured.
|
|
30176
|
+
* Token to provide CompilerOptions in the platform injector.
|
|
30190
30177
|
*
|
|
30191
|
-
*
|
|
30178
|
+
* @publicApi
|
|
30179
|
+
*/
|
|
30180
|
+
const COMPILER_OPTIONS = new InjectionToken('compilerOptions');
|
|
30181
|
+
/**
|
|
30182
|
+
* A factory for creating a Compiler
|
|
30192
30183
|
*
|
|
30193
|
-
*
|
|
30184
|
+
* @publicApi
|
|
30194
30185
|
*
|
|
30195
|
-
*
|
|
30186
|
+
* @deprecated
|
|
30187
|
+
* Ivy JIT mode doesn't require accessing this symbol.
|
|
30188
|
+
* See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
|
|
30189
|
+
* additional context.
|
|
30190
|
+
*/
|
|
30191
|
+
class CompilerFactory {
|
|
30192
|
+
}
|
|
30193
|
+
|
|
30194
|
+
/**
|
|
30195
|
+
* These are the data structures that our framework injector profiler will fill with data in order
|
|
30196
|
+
* to support DI debugging APIs.
|
|
30196
30197
|
*
|
|
30197
|
-
*
|
|
30198
|
+
* resolverToTokenToDependencies: Maps an injector to a Map of tokens to an Array of
|
|
30199
|
+
* dependencies. Injector -> Token -> Dependencies This is used to support the
|
|
30200
|
+
* getDependenciesFromInjectable API, which takes in an injector and a token and returns it's
|
|
30201
|
+
* dependencies.
|
|
30198
30202
|
*
|
|
30199
|
-
*
|
|
30203
|
+
* resolverToProviders: Maps a DI resolver (an Injector or a TNode) to the providers configured
|
|
30204
|
+
* within it This is used to support the getInjectorProviders API, which takes in an injector and
|
|
30205
|
+
* returns the providers that it was configured with. Note that for the element injector case we
|
|
30206
|
+
* use the TNode instead of the LView as the DI resolver. This is because the registration of
|
|
30207
|
+
* providers happens only once per type of TNode. If an injector is created with an identical TNode,
|
|
30208
|
+
* the providers for that injector will not be reconfigured.
|
|
30200
30209
|
*
|
|
30201
|
-
*
|
|
30202
|
-
*
|
|
30210
|
+
* standaloneInjectorToComponent: Maps the injector of a standalone component to the standalone
|
|
30211
|
+
* component that it is associated with. Used in the getInjectorProviders API, specificially in the
|
|
30212
|
+
* discovery of import paths for each provider. This is necessary because the imports array of a
|
|
30213
|
+
* standalone component is processed and configured in its standalone injector, but exists within
|
|
30214
|
+
* the component's definition. Because getInjectorProviders takes in an injector, if that injector
|
|
30215
|
+
* is the injector of a standalone component, we need to be able to discover the place where the
|
|
30216
|
+
* imports array is located (the component) in order to flatten the imports array within it to
|
|
30217
|
+
* discover all of it's providers.
|
|
30203
30218
|
*
|
|
30204
|
-
* ```ts
|
|
30205
|
-
* {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}
|
|
30206
|
-
* ```
|
|
30207
30219
|
*
|
|
30208
|
-
*
|
|
30220
|
+
* All of these data structures are instantiated with WeakMaps. This will ensure that the presence
|
|
30221
|
+
* of any object in the keys of these maps does not prevent the garbage collector from collecting
|
|
30222
|
+
* those objects. Because of this property of WeakMaps, these data structures will never be the
|
|
30223
|
+
* source of a memory leak.
|
|
30209
30224
|
*
|
|
30210
|
-
*
|
|
30211
|
-
*
|
|
30225
|
+
* An example of this advantage: When components are destroyed, we don't need to do
|
|
30226
|
+
* any additional work to remove that component from our mappings.
|
|
30212
30227
|
*
|
|
30213
|
-
|
|
30214
|
-
|
|
30215
|
-
|
|
30228
|
+
*/
|
|
30229
|
+
class DIDebugData {
|
|
30230
|
+
constructor() {
|
|
30231
|
+
this.resolverToTokenToDependencies = new WeakMap();
|
|
30232
|
+
this.resolverToProviders = new WeakMap();
|
|
30233
|
+
this.standaloneInjectorToComponent = new WeakMap();
|
|
30234
|
+
}
|
|
30235
|
+
reset() {
|
|
30236
|
+
this.resolverToTokenToDependencies =
|
|
30237
|
+
new WeakMap();
|
|
30238
|
+
this.resolverToProviders = new WeakMap();
|
|
30239
|
+
this.standaloneInjectorToComponent = new WeakMap();
|
|
30240
|
+
}
|
|
30241
|
+
}
|
|
30242
|
+
let frameworkDIDebugData = new DIDebugData();
|
|
30243
|
+
function getFrameworkDIDebugData() {
|
|
30244
|
+
return frameworkDIDebugData;
|
|
30245
|
+
}
|
|
30246
|
+
/**
|
|
30247
|
+
* Initalize default handling of injector events. This handling parses events
|
|
30248
|
+
* as they are emitted and constructs the data structures necessary to support
|
|
30249
|
+
* some of debug APIs.
|
|
30216
30250
|
*
|
|
30217
|
-
*
|
|
30218
|
-
*
|
|
30219
|
-
* });
|
|
30220
|
-
* ```
|
|
30251
|
+
* See handleInjectEvent, handleCreateEvent and handleProviderConfiguredEvent
|
|
30252
|
+
* for descriptions of each handler
|
|
30221
30253
|
*
|
|
30222
|
-
*
|
|
30254
|
+
* Supported APIs:
|
|
30255
|
+
* - getDependenciesFromInjectable
|
|
30256
|
+
* - getInjectorProviders
|
|
30223
30257
|
*/
|
|
30224
|
-
|
|
30225
|
-
|
|
30226
|
-
|
|
30227
|
-
}
|
|
30258
|
+
function setupFrameworkInjectorProfiler() {
|
|
30259
|
+
frameworkDIDebugData.reset();
|
|
30260
|
+
setInjectorProfiler((injectorProfilerEvent) => handleInjectorProfilerEvent(injectorProfilerEvent));
|
|
30261
|
+
}
|
|
30262
|
+
function handleInjectorProfilerEvent(injectorProfilerEvent) {
|
|
30263
|
+
const { context, type } = injectorProfilerEvent;
|
|
30264
|
+
if (type === 0 /* InjectorProfilerEventType.Inject */) {
|
|
30265
|
+
handleInjectEvent(context, injectorProfilerEvent.service);
|
|
30266
|
+
}
|
|
30267
|
+
else if (type === 1 /* InjectorProfilerEventType.InstanceCreatedByInjector */) {
|
|
30268
|
+
handleInstanceCreatedByInjectorEvent(context, injectorProfilerEvent.instance);
|
|
30269
|
+
}
|
|
30270
|
+
else if (type === 2 /* InjectorProfilerEventType.ProviderConfigured */) {
|
|
30271
|
+
handleProviderConfiguredEvent(context, injectorProfilerEvent.providerRecord);
|
|
30272
|
+
}
|
|
30273
|
+
}
|
|
30228
30274
|
/**
|
|
30229
|
-
* Use this token at bootstrap to provide the content of your translation file (`xtb`,
|
|
30230
|
-
* `xlf` or `xlf2`) when you want to translate your application in another language.
|
|
30231
30275
|
*
|
|
30232
|
-
*
|
|
30233
|
-
*
|
|
30234
|
-
* @usageNotes
|
|
30235
|
-
* ### Example
|
|
30236
|
-
*
|
|
30237
|
-
* ```typescript
|
|
30238
|
-
* import { TRANSLATIONS } from '@angular/core';
|
|
30239
|
-
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
30240
|
-
* import { AppModule } from './app/app.module';
|
|
30241
|
-
*
|
|
30242
|
-
* // content of your translation file
|
|
30243
|
-
* const translations = '....';
|
|
30244
|
-
*
|
|
30245
|
-
* platformBrowserDynamic().bootstrapModule(AppModule, {
|
|
30246
|
-
* providers: [{provide: TRANSLATIONS, useValue: translations }]
|
|
30247
|
-
* });
|
|
30248
|
-
* ```
|
|
30249
|
-
*
|
|
30250
|
-
* @publicApi
|
|
30251
|
-
*/
|
|
30252
|
-
const TRANSLATIONS = new InjectionToken('Translations');
|
|
30253
|
-
/**
|
|
30254
|
-
* Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`,
|
|
30255
|
-
* `xlf` or `xlf2`.
|
|
30256
|
-
*
|
|
30257
|
-
* See the [i18n guide](guide/i18n-common-merge) for more information.
|
|
30258
|
-
*
|
|
30259
|
-
* @usageNotes
|
|
30260
|
-
* ### Example
|
|
30261
|
-
*
|
|
30262
|
-
* ```typescript
|
|
30263
|
-
* import { TRANSLATIONS_FORMAT } from '@angular/core';
|
|
30264
|
-
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
30265
|
-
* import { AppModule } from './app/app.module';
|
|
30266
|
-
*
|
|
30267
|
-
* platformBrowserDynamic().bootstrapModule(AppModule, {
|
|
30268
|
-
* providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]
|
|
30269
|
-
* });
|
|
30270
|
-
* ```
|
|
30271
|
-
*
|
|
30272
|
-
* @publicApi
|
|
30273
|
-
*/
|
|
30274
|
-
const TRANSLATIONS_FORMAT = new InjectionToken('TranslationsFormat');
|
|
30275
|
-
/**
|
|
30276
|
-
* Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy
|
|
30277
|
-
* that the compiler should use in case of missing translations:
|
|
30278
|
-
* - Error: throw if you have missing translations.
|
|
30279
|
-
* - Warning (default): show a warning in the console and/or shell.
|
|
30280
|
-
* - Ignore: do nothing.
|
|
30281
|
-
*
|
|
30282
|
-
* See the [i18n guide](guide/i18n-common-merge#report-missing-translations) for more information.
|
|
30283
|
-
*
|
|
30284
|
-
* @usageNotes
|
|
30285
|
-
* ### Example
|
|
30286
|
-
* ```typescript
|
|
30287
|
-
* import { MissingTranslationStrategy } from '@angular/core';
|
|
30288
|
-
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
30289
|
-
* import { AppModule } from './app/app.module';
|
|
30290
|
-
*
|
|
30291
|
-
* platformBrowserDynamic().bootstrapModule(AppModule, {
|
|
30292
|
-
* missingTranslation: MissingTranslationStrategy.Error
|
|
30293
|
-
* });
|
|
30294
|
-
* ```
|
|
30295
|
-
*
|
|
30296
|
-
* @publicApi
|
|
30297
|
-
*/
|
|
30298
|
-
var MissingTranslationStrategy;
|
|
30299
|
-
(function (MissingTranslationStrategy) {
|
|
30300
|
-
MissingTranslationStrategy[MissingTranslationStrategy["Error"] = 0] = "Error";
|
|
30301
|
-
MissingTranslationStrategy[MissingTranslationStrategy["Warning"] = 1] = "Warning";
|
|
30302
|
-
MissingTranslationStrategy[MissingTranslationStrategy["Ignore"] = 2] = "Ignore";
|
|
30303
|
-
})(MissingTranslationStrategy || (MissingTranslationStrategy = {}));
|
|
30304
|
-
|
|
30305
|
-
// A delay in milliseconds before the scan is run after onLoad, to avoid any
|
|
30306
|
-
// potential race conditions with other LCP-related functions. This delay
|
|
30307
|
-
// happens outside of the main JavaScript execution and will only effect the timing
|
|
30308
|
-
// on when the warning becomes visible in the console.
|
|
30309
|
-
const SCAN_DELAY = 200;
|
|
30310
|
-
const OVERSIZED_IMAGE_TOLERANCE = 1200;
|
|
30311
|
-
class ImagePerformanceWarning {
|
|
30312
|
-
constructor() {
|
|
30313
|
-
// Map of full image URLs -> original `ngSrc` values.
|
|
30314
|
-
this.window = null;
|
|
30315
|
-
this.observer = null;
|
|
30316
|
-
this.options = inject(IMAGE_CONFIG);
|
|
30317
|
-
this.ngZone = inject(NgZone);
|
|
30318
|
-
}
|
|
30319
|
-
start() {
|
|
30320
|
-
if (typeof PerformanceObserver === 'undefined' ||
|
|
30321
|
-
(this.options?.disableImageSizeWarning && this.options?.disableImageLazyLoadWarning)) {
|
|
30322
|
-
return;
|
|
30323
|
-
}
|
|
30324
|
-
this.observer = this.initPerformanceObserver();
|
|
30325
|
-
const doc = getDocument();
|
|
30326
|
-
const win = doc.defaultView;
|
|
30327
|
-
if (typeof win !== 'undefined') {
|
|
30328
|
-
this.window = win;
|
|
30329
|
-
// Wait to avoid race conditions where LCP image triggers
|
|
30330
|
-
// load event before it's recorded by the performance observer
|
|
30331
|
-
const waitToScan = () => {
|
|
30332
|
-
setTimeout(this.scanImages.bind(this), SCAN_DELAY);
|
|
30333
|
-
};
|
|
30334
|
-
// Angular doesn't have to run change detection whenever any asynchronous tasks are invoked in
|
|
30335
|
-
// the scope of this functionality.
|
|
30336
|
-
this.ngZone.runOutsideAngular(() => {
|
|
30337
|
-
// Consider the case when the application is created and destroyed multiple times.
|
|
30338
|
-
// Typically, applications are created instantly once the page is loaded, and the
|
|
30339
|
-
// `window.load` listener is always triggered. However, the `window.load` event will never
|
|
30340
|
-
// be fired if the page is loaded, and the application is created later. Checking for
|
|
30341
|
-
// `readyState` is the easiest way to determine whether the page has been loaded or not.
|
|
30342
|
-
if (doc.readyState === 'complete') {
|
|
30343
|
-
waitToScan();
|
|
30344
|
-
}
|
|
30345
|
-
else {
|
|
30346
|
-
this.window?.addEventListener('load', waitToScan, { once: true });
|
|
30347
|
-
}
|
|
30348
|
-
});
|
|
30349
|
-
}
|
|
30350
|
-
}
|
|
30351
|
-
ngOnDestroy() {
|
|
30352
|
-
this.observer?.disconnect();
|
|
30353
|
-
}
|
|
30354
|
-
initPerformanceObserver() {
|
|
30355
|
-
if (typeof PerformanceObserver === 'undefined') {
|
|
30356
|
-
return null;
|
|
30357
|
-
}
|
|
30358
|
-
const observer = new PerformanceObserver((entryList) => {
|
|
30359
|
-
const entries = entryList.getEntries();
|
|
30360
|
-
if (entries.length === 0)
|
|
30361
|
-
return;
|
|
30362
|
-
// We use the latest entry produced by the `PerformanceObserver` as the best
|
|
30363
|
-
// signal on which element is actually an LCP one. As an example, the first image to load on
|
|
30364
|
-
// a page, by virtue of being the only thing on the page so far, is often a LCP candidate
|
|
30365
|
-
// and gets reported by PerformanceObserver, but isn't necessarily the LCP element.
|
|
30366
|
-
const lcpElement = entries[entries.length - 1];
|
|
30367
|
-
// Cast to `any` due to missing `element` on the `LargestContentfulPaint` type of entry.
|
|
30368
|
-
// See https://developer.mozilla.org/en-US/docs/Web/API/LargestContentfulPaint
|
|
30369
|
-
const imgSrc = lcpElement.element?.src ?? '';
|
|
30370
|
-
// Exclude `data:` and `blob:` URLs, since they are fetched resources.
|
|
30371
|
-
if (imgSrc.startsWith('data:') || imgSrc.startsWith('blob:'))
|
|
30372
|
-
return;
|
|
30373
|
-
this.lcpImageUrl = imgSrc;
|
|
30374
|
-
});
|
|
30375
|
-
observer.observe({ type: 'largest-contentful-paint', buffered: true });
|
|
30376
|
-
return observer;
|
|
30377
|
-
}
|
|
30378
|
-
scanImages() {
|
|
30379
|
-
const images = getDocument().querySelectorAll('img');
|
|
30380
|
-
let lcpElementFound, lcpElementLoadedCorrectly = false;
|
|
30381
|
-
images.forEach(image => {
|
|
30382
|
-
if (!this.options?.disableImageSizeWarning) {
|
|
30383
|
-
for (const image of images) {
|
|
30384
|
-
// Image elements using the NgOptimizedImage directive are excluded,
|
|
30385
|
-
// as that directive has its own version of this check.
|
|
30386
|
-
if (!image.getAttribute('ng-img') && this.isOversized(image)) {
|
|
30387
|
-
logOversizedImageWarning(image.src);
|
|
30388
|
-
}
|
|
30389
|
-
}
|
|
30390
|
-
}
|
|
30391
|
-
if (!this.options?.disableImageLazyLoadWarning && this.lcpImageUrl) {
|
|
30392
|
-
if (image.src === this.lcpImageUrl) {
|
|
30393
|
-
lcpElementFound = true;
|
|
30394
|
-
if (image.loading !== 'lazy' || image.getAttribute('ng-img')) {
|
|
30395
|
-
// This variable is set to true and never goes back to false to account
|
|
30396
|
-
// for the case where multiple images have the same src url, and some
|
|
30397
|
-
// have lazy loading while others don't.
|
|
30398
|
-
// Also ignore NgOptimizedImage because there's a different warning for that.
|
|
30399
|
-
lcpElementLoadedCorrectly = true;
|
|
30400
|
-
}
|
|
30401
|
-
}
|
|
30402
|
-
}
|
|
30403
|
-
});
|
|
30404
|
-
if (lcpElementFound && !lcpElementLoadedCorrectly && this.lcpImageUrl &&
|
|
30405
|
-
!this.options?.disableImageLazyLoadWarning) {
|
|
30406
|
-
logLazyLCPWarning(this.lcpImageUrl);
|
|
30407
|
-
}
|
|
30408
|
-
}
|
|
30409
|
-
isOversized(image) {
|
|
30410
|
-
if (!this.window) {
|
|
30411
|
-
return false;
|
|
30412
|
-
}
|
|
30413
|
-
const computedStyle = this.window.getComputedStyle(image);
|
|
30414
|
-
let renderedWidth = parseFloat(computedStyle.getPropertyValue('width'));
|
|
30415
|
-
let renderedHeight = parseFloat(computedStyle.getPropertyValue('height'));
|
|
30416
|
-
const boxSizing = computedStyle.getPropertyValue('box-sizing');
|
|
30417
|
-
const objectFit = computedStyle.getPropertyValue('object-fit');
|
|
30418
|
-
if (objectFit === `cover`) {
|
|
30419
|
-
// Object fit cover may indicate a use case such as a sprite sheet where
|
|
30420
|
-
// this warning does not apply.
|
|
30421
|
-
return false;
|
|
30422
|
-
}
|
|
30423
|
-
if (boxSizing === 'border-box') {
|
|
30424
|
-
const paddingTop = computedStyle.getPropertyValue('padding-top');
|
|
30425
|
-
const paddingRight = computedStyle.getPropertyValue('padding-right');
|
|
30426
|
-
const paddingBottom = computedStyle.getPropertyValue('padding-bottom');
|
|
30427
|
-
const paddingLeft = computedStyle.getPropertyValue('padding-left');
|
|
30428
|
-
renderedWidth -= parseFloat(paddingRight) + parseFloat(paddingLeft);
|
|
30429
|
-
renderedHeight -= parseFloat(paddingTop) + parseFloat(paddingBottom);
|
|
30430
|
-
}
|
|
30431
|
-
const intrinsicWidth = image.naturalWidth;
|
|
30432
|
-
const intrinsicHeight = image.naturalHeight;
|
|
30433
|
-
const recommendedWidth = this.window.devicePixelRatio * renderedWidth;
|
|
30434
|
-
const recommendedHeight = this.window.devicePixelRatio * renderedHeight;
|
|
30435
|
-
const oversizedWidth = (intrinsicWidth - recommendedWidth) >= OVERSIZED_IMAGE_TOLERANCE;
|
|
30436
|
-
const oversizedHeight = (intrinsicHeight - recommendedHeight) >= OVERSIZED_IMAGE_TOLERANCE;
|
|
30437
|
-
return oversizedWidth || oversizedHeight;
|
|
30438
|
-
}
|
|
30439
|
-
static { this.ɵfac = function ImagePerformanceWarning_Factory(t) { return new (t || ImagePerformanceWarning)(); }; }
|
|
30440
|
-
static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ImagePerformanceWarning, factory: ImagePerformanceWarning.ɵfac, providedIn: 'root' }); }
|
|
30441
|
-
}
|
|
30442
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ImagePerformanceWarning, [{
|
|
30443
|
-
type: Injectable,
|
|
30444
|
-
args: [{ providedIn: 'root' }]
|
|
30445
|
-
}], null, null); })();
|
|
30446
|
-
function logLazyLCPWarning(src) {
|
|
30447
|
-
console.warn(formatRuntimeError(-913 /* RuntimeErrorCode.IMAGE_PERFORMANCE_WARNING */, `An image with src ${src} is the Largest Contentful Paint (LCP) element ` +
|
|
30448
|
-
`but was given a "loading" value of "lazy", which can negatively impact ` +
|
|
30449
|
-
`application loading performance. This warning can be addressed by ` +
|
|
30450
|
-
`changing the loading value of the LCP image to "eager", or by using the ` +
|
|
30451
|
-
`NgOptimizedImage directive's prioritization utilities. For more ` +
|
|
30452
|
-
`information about addressing or disabling this warning, see ` +
|
|
30453
|
-
`https://angular.io/errors/NG0913`));
|
|
30454
|
-
}
|
|
30455
|
-
function logOversizedImageWarning(src) {
|
|
30456
|
-
console.warn(formatRuntimeError(-913 /* RuntimeErrorCode.IMAGE_PERFORMANCE_WARNING */, `An image with src ${src} has intrinsic file dimensions much larger than its ` +
|
|
30457
|
-
`rendered size. This can negatively impact application loading performance. ` +
|
|
30458
|
-
`For more information about addressing or disabling this warning, see ` +
|
|
30459
|
-
`https://angular.io/errors/NG0913`));
|
|
30460
|
-
}
|
|
30461
|
-
|
|
30462
|
-
/**
|
|
30463
|
-
* *Internal* service that keeps track of pending tasks happening in the system
|
|
30464
|
-
* during the initial rendering. No tasks are tracked after an initial
|
|
30465
|
-
* rendering.
|
|
30466
|
-
*
|
|
30467
|
-
* This information is needed to make sure that the serialization on the server
|
|
30468
|
-
* is delayed until all tasks in the queue (such as an initial navigation or a
|
|
30469
|
-
* pending HTTP request) are completed.
|
|
30470
|
-
*/
|
|
30471
|
-
class InitialRenderPendingTasks {
|
|
30472
|
-
constructor() {
|
|
30473
|
-
this.taskId = 0;
|
|
30474
|
-
this.pendingTasks = new Set();
|
|
30475
|
-
this.hasPendingTasks = new BehaviorSubject(false);
|
|
30476
|
-
}
|
|
30477
|
-
add() {
|
|
30478
|
-
this.hasPendingTasks.next(true);
|
|
30479
|
-
const taskId = this.taskId++;
|
|
30480
|
-
this.pendingTasks.add(taskId);
|
|
30481
|
-
return taskId;
|
|
30482
|
-
}
|
|
30483
|
-
remove(taskId) {
|
|
30484
|
-
this.pendingTasks.delete(taskId);
|
|
30485
|
-
if (this.pendingTasks.size === 0) {
|
|
30486
|
-
this.hasPendingTasks.next(false);
|
|
30487
|
-
}
|
|
30488
|
-
}
|
|
30489
|
-
ngOnDestroy() {
|
|
30490
|
-
this.pendingTasks.clear();
|
|
30491
|
-
this.hasPendingTasks.next(false);
|
|
30492
|
-
}
|
|
30493
|
-
static { this.ɵfac = function InitialRenderPendingTasks_Factory(t) { return new (t || InitialRenderPendingTasks)(); }; }
|
|
30494
|
-
static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: InitialRenderPendingTasks, factory: InitialRenderPendingTasks.ɵfac, providedIn: 'root' }); }
|
|
30495
|
-
}
|
|
30496
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(InitialRenderPendingTasks, [{
|
|
30497
|
-
type: Injectable,
|
|
30498
|
-
args: [{ providedIn: 'root' }]
|
|
30499
|
-
}], null, null); })();
|
|
30500
|
-
|
|
30501
|
-
/**
|
|
30502
|
-
* Combination of NgModuleFactory and ComponentFactories.
|
|
30503
|
-
*
|
|
30504
|
-
* @publicApi
|
|
30505
|
-
*
|
|
30506
|
-
* @deprecated
|
|
30507
|
-
* Ivy JIT mode doesn't require accessing this symbol.
|
|
30508
|
-
* See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
|
|
30509
|
-
* additional context.
|
|
30510
|
-
*/
|
|
30511
|
-
class ModuleWithComponentFactories {
|
|
30512
|
-
constructor(ngModuleFactory, componentFactories) {
|
|
30513
|
-
this.ngModuleFactory = ngModuleFactory;
|
|
30514
|
-
this.componentFactories = componentFactories;
|
|
30515
|
-
}
|
|
30516
|
-
}
|
|
30517
|
-
/**
|
|
30518
|
-
* Low-level service for running the angular compiler during runtime
|
|
30519
|
-
* to create {@link ComponentFactory}s, which
|
|
30520
|
-
* can later be used to create and render a Component instance.
|
|
30521
|
-
*
|
|
30522
|
-
* Each `@NgModule` provides an own `Compiler` to its injector,
|
|
30523
|
-
* that will use the directives/pipes of the ng module for compilation
|
|
30524
|
-
* of components.
|
|
30525
|
-
*
|
|
30526
|
-
* @publicApi
|
|
30527
|
-
*
|
|
30528
|
-
* @deprecated
|
|
30529
|
-
* Ivy JIT mode doesn't require accessing this symbol.
|
|
30530
|
-
* See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
|
|
30531
|
-
* additional context.
|
|
30532
|
-
*/
|
|
30533
|
-
class Compiler {
|
|
30534
|
-
/**
|
|
30535
|
-
* Compiles the given NgModule and all of its components. All templates of the components
|
|
30536
|
-
* have to be inlined.
|
|
30537
|
-
*/
|
|
30538
|
-
compileModuleSync(moduleType) {
|
|
30539
|
-
return new NgModuleFactory(moduleType);
|
|
30540
|
-
}
|
|
30541
|
-
/**
|
|
30542
|
-
* Compiles the given NgModule and all of its components
|
|
30543
|
-
*/
|
|
30544
|
-
compileModuleAsync(moduleType) {
|
|
30545
|
-
return Promise.resolve(this.compileModuleSync(moduleType));
|
|
30546
|
-
}
|
|
30547
|
-
/**
|
|
30548
|
-
* Same as {@link #compileModuleSync} but also creates ComponentFactories for all components.
|
|
30549
|
-
*/
|
|
30550
|
-
compileModuleAndAllComponentsSync(moduleType) {
|
|
30551
|
-
const ngModuleFactory = this.compileModuleSync(moduleType);
|
|
30552
|
-
const moduleDef = getNgModuleDef(moduleType);
|
|
30553
|
-
const componentFactories = maybeUnwrapFn(moduleDef.declarations)
|
|
30554
|
-
.reduce((factories, declaration) => {
|
|
30555
|
-
const componentDef = getComponentDef(declaration);
|
|
30556
|
-
componentDef && factories.push(new ComponentFactory(componentDef));
|
|
30557
|
-
return factories;
|
|
30558
|
-
}, []);
|
|
30559
|
-
return new ModuleWithComponentFactories(ngModuleFactory, componentFactories);
|
|
30560
|
-
}
|
|
30561
|
-
/**
|
|
30562
|
-
* Same as {@link #compileModuleAsync} but also creates ComponentFactories for all components.
|
|
30563
|
-
*/
|
|
30564
|
-
compileModuleAndAllComponentsAsync(moduleType) {
|
|
30565
|
-
return Promise.resolve(this.compileModuleAndAllComponentsSync(moduleType));
|
|
30566
|
-
}
|
|
30567
|
-
/**
|
|
30568
|
-
* Clears all caches.
|
|
30569
|
-
*/
|
|
30570
|
-
clearCache() { }
|
|
30571
|
-
/**
|
|
30572
|
-
* Clears the cache for the given component/ngModule.
|
|
30573
|
-
*/
|
|
30574
|
-
clearCacheFor(type) { }
|
|
30575
|
-
/**
|
|
30576
|
-
* Returns the id for a given NgModule, if one is defined and known to the compiler.
|
|
30577
|
-
*/
|
|
30578
|
-
getModuleId(moduleType) {
|
|
30579
|
-
return undefined;
|
|
30580
|
-
}
|
|
30581
|
-
static { this.ɵfac = function Compiler_Factory(t) { return new (t || Compiler)(); }; }
|
|
30582
|
-
static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Compiler, factory: Compiler.ɵfac, providedIn: 'root' }); }
|
|
30583
|
-
}
|
|
30584
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Compiler, [{
|
|
30585
|
-
type: Injectable,
|
|
30586
|
-
args: [{ providedIn: 'root' }]
|
|
30587
|
-
}], null, null); })();
|
|
30588
|
-
/**
|
|
30589
|
-
* Token to provide CompilerOptions in the platform injector.
|
|
30590
|
-
*
|
|
30591
|
-
* @publicApi
|
|
30592
|
-
*/
|
|
30593
|
-
const COMPILER_OPTIONS = new InjectionToken('compilerOptions');
|
|
30594
|
-
/**
|
|
30595
|
-
* A factory for creating a Compiler
|
|
30596
|
-
*
|
|
30597
|
-
* @publicApi
|
|
30598
|
-
*
|
|
30599
|
-
* @deprecated
|
|
30600
|
-
* Ivy JIT mode doesn't require accessing this symbol.
|
|
30601
|
-
* See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
|
|
30602
|
-
* additional context.
|
|
30603
|
-
*/
|
|
30604
|
-
class CompilerFactory {
|
|
30605
|
-
}
|
|
30606
|
-
|
|
30607
|
-
/**
|
|
30608
|
-
* These are the data structures that our framework injector profiler will fill with data in order
|
|
30609
|
-
* to support DI debugging APIs.
|
|
30610
|
-
*
|
|
30611
|
-
* resolverToTokenToDependencies: Maps an injector to a Map of tokens to an Array of
|
|
30612
|
-
* dependencies. Injector -> Token -> Dependencies This is used to support the
|
|
30613
|
-
* getDependenciesFromInjectable API, which takes in an injector and a token and returns it's
|
|
30614
|
-
* dependencies.
|
|
30615
|
-
*
|
|
30616
|
-
* resolverToProviders: Maps a DI resolver (an Injector or a TNode) to the providers configured
|
|
30617
|
-
* within it This is used to support the getInjectorProviders API, which takes in an injector and
|
|
30618
|
-
* returns the providers that it was configured with. Note that for the element injector case we
|
|
30619
|
-
* use the TNode instead of the LView as the DI resolver. This is because the registration of
|
|
30620
|
-
* providers happens only once per type of TNode. If an injector is created with an identical TNode,
|
|
30621
|
-
* the providers for that injector will not be reconfigured.
|
|
30622
|
-
*
|
|
30623
|
-
* standaloneInjectorToComponent: Maps the injector of a standalone component to the standalone
|
|
30624
|
-
* component that it is associated with. Used in the getInjectorProviders API, specificially in the
|
|
30625
|
-
* discovery of import paths for each provider. This is necessary because the imports array of a
|
|
30626
|
-
* standalone component is processed and configured in its standalone injector, but exists within
|
|
30627
|
-
* the component's definition. Because getInjectorProviders takes in an injector, if that injector
|
|
30628
|
-
* is the injector of a standalone component, we need to be able to discover the place where the
|
|
30629
|
-
* imports array is located (the component) in order to flatten the imports array within it to
|
|
30630
|
-
* discover all of it's providers.
|
|
30631
|
-
*
|
|
30632
|
-
*
|
|
30633
|
-
* All of these data structures are instantiated with WeakMaps. This will ensure that the presence
|
|
30634
|
-
* of any object in the keys of these maps does not prevent the garbage collector from collecting
|
|
30635
|
-
* those objects. Because of this property of WeakMaps, these data structures will never be the
|
|
30636
|
-
* source of a memory leak.
|
|
30637
|
-
*
|
|
30638
|
-
* An example of this advantage: When components are destroyed, we don't need to do
|
|
30639
|
-
* any additional work to remove that component from our mappings.
|
|
30640
|
-
*
|
|
30641
|
-
*/
|
|
30642
|
-
class DIDebugData {
|
|
30643
|
-
constructor() {
|
|
30644
|
-
this.resolverToTokenToDependencies = new WeakMap();
|
|
30645
|
-
this.resolverToProviders = new WeakMap();
|
|
30646
|
-
this.standaloneInjectorToComponent = new WeakMap();
|
|
30647
|
-
}
|
|
30648
|
-
reset() {
|
|
30649
|
-
this.resolverToTokenToDependencies =
|
|
30650
|
-
new WeakMap();
|
|
30651
|
-
this.resolverToProviders = new WeakMap();
|
|
30652
|
-
this.standaloneInjectorToComponent = new WeakMap();
|
|
30653
|
-
}
|
|
30654
|
-
}
|
|
30655
|
-
let frameworkDIDebugData = new DIDebugData();
|
|
30656
|
-
function getFrameworkDIDebugData() {
|
|
30657
|
-
return frameworkDIDebugData;
|
|
30658
|
-
}
|
|
30659
|
-
/**
|
|
30660
|
-
* Initalize default handling of injector events. This handling parses events
|
|
30661
|
-
* as they are emitted and constructs the data structures necessary to support
|
|
30662
|
-
* some of debug APIs.
|
|
30663
|
-
*
|
|
30664
|
-
* See handleInjectEvent, handleCreateEvent and handleProviderConfiguredEvent
|
|
30665
|
-
* for descriptions of each handler
|
|
30666
|
-
*
|
|
30667
|
-
* Supported APIs:
|
|
30668
|
-
* - getDependenciesFromInjectable
|
|
30669
|
-
* - getInjectorProviders
|
|
30670
|
-
*/
|
|
30671
|
-
function setupFrameworkInjectorProfiler() {
|
|
30672
|
-
frameworkDIDebugData.reset();
|
|
30673
|
-
setInjectorProfiler((injectorProfilerEvent) => handleInjectorProfilerEvent(injectorProfilerEvent));
|
|
30674
|
-
}
|
|
30675
|
-
function handleInjectorProfilerEvent(injectorProfilerEvent) {
|
|
30676
|
-
const { context, type } = injectorProfilerEvent;
|
|
30677
|
-
if (type === 0 /* InjectorProfilerEventType.Inject */) {
|
|
30678
|
-
handleInjectEvent(context, injectorProfilerEvent.service);
|
|
30679
|
-
}
|
|
30680
|
-
else if (type === 1 /* InjectorProfilerEventType.InstanceCreatedByInjector */) {
|
|
30681
|
-
handleInstanceCreatedByInjectorEvent(context, injectorProfilerEvent.instance);
|
|
30682
|
-
}
|
|
30683
|
-
else if (type === 2 /* InjectorProfilerEventType.ProviderConfigured */) {
|
|
30684
|
-
handleProviderConfiguredEvent(context, injectorProfilerEvent.providerRecord);
|
|
30685
|
-
}
|
|
30686
|
-
}
|
|
30687
|
-
/**
|
|
30688
|
-
*
|
|
30689
|
-
* Stores the injected service in frameworkDIDebugData.resolverToTokenToDependencies
|
|
30690
|
-
* based on it's injector and token.
|
|
30276
|
+
* Stores the injected service in frameworkDIDebugData.resolverToTokenToDependencies
|
|
30277
|
+
* based on it's injector and token.
|
|
30691
30278
|
*
|
|
30692
30279
|
* @param context InjectorProfilerContext the injection context that this event occurred in.
|
|
30693
30280
|
* @param data InjectedService the service associated with this inject event.
|
|
@@ -30864,6 +30451,7 @@ function applyChanges(component) {
|
|
|
30864
30451
|
*/
|
|
30865
30452
|
function detectChanges(component) {
|
|
30866
30453
|
const view = getComponentViewByInstance(component);
|
|
30454
|
+
view[FLAGS] |= 1024 /* LViewFlags.RefreshView */;
|
|
30867
30455
|
detectChangesInternal(view);
|
|
30868
30456
|
}
|
|
30869
30457
|
|
|
@@ -31759,19 +31347,190 @@ function setTestabilityGetter(getter) {
|
|
|
31759
31347
|
}
|
|
31760
31348
|
let _testabilityGetter;
|
|
31761
31349
|
|
|
31762
|
-
let _platformInjector = null;
|
|
31763
31350
|
/**
|
|
31764
|
-
*
|
|
31765
|
-
* one
|
|
31351
|
+
* A [DI token](guide/glossary#di-token "DI token definition") that you can use to provide
|
|
31352
|
+
* one or more initialization functions.
|
|
31353
|
+
*
|
|
31354
|
+
* The provided functions are injected at application startup and executed during
|
|
31355
|
+
* app initialization. If any of these functions returns a Promise or an Observable, initialization
|
|
31356
|
+
* does not complete until the Promise is resolved or the Observable is completed.
|
|
31357
|
+
*
|
|
31358
|
+
* You can, for example, create a factory function that loads language data
|
|
31359
|
+
* or an external configuration, and provide that function to the `APP_INITIALIZER` token.
|
|
31360
|
+
* The function is executed during the application bootstrap process,
|
|
31361
|
+
* and the needed data is available on startup.
|
|
31362
|
+
*
|
|
31363
|
+
* @see {@link ApplicationInitStatus}
|
|
31364
|
+
*
|
|
31365
|
+
* @usageNotes
|
|
31366
|
+
*
|
|
31367
|
+
* The following example illustrates how to configure a multi-provider using `APP_INITIALIZER` token
|
|
31368
|
+
* and a function returning a promise.
|
|
31369
|
+
* ### Example with NgModule-based application
|
|
31370
|
+
* ```
|
|
31371
|
+
* function initializeApp(): Promise<any> {
|
|
31372
|
+
* return new Promise((resolve, reject) => {
|
|
31373
|
+
* // Do some asynchronous stuff
|
|
31374
|
+
* resolve();
|
|
31375
|
+
* });
|
|
31376
|
+
* }
|
|
31377
|
+
*
|
|
31378
|
+
* @NgModule({
|
|
31379
|
+
* imports: [BrowserModule],
|
|
31380
|
+
* declarations: [AppComponent],
|
|
31381
|
+
* bootstrap: [AppComponent],
|
|
31382
|
+
* providers: [{
|
|
31383
|
+
* provide: APP_INITIALIZER,
|
|
31384
|
+
* useFactory: () => initializeApp,
|
|
31385
|
+
* multi: true
|
|
31386
|
+
* }]
|
|
31387
|
+
* })
|
|
31388
|
+
* export class AppModule {}
|
|
31389
|
+
* ```
|
|
31390
|
+
*
|
|
31391
|
+
* ### Example with standalone application
|
|
31392
|
+
* ```
|
|
31393
|
+
* export function initializeApp(http: HttpClient) {
|
|
31394
|
+
* return (): Promise<any> =>
|
|
31395
|
+
* firstValueFrom(
|
|
31396
|
+
* http
|
|
31397
|
+
* .get("https://someUrl.com/api/user")
|
|
31398
|
+
* .pipe(tap(user => { ... }))
|
|
31399
|
+
* );
|
|
31400
|
+
* }
|
|
31401
|
+
*
|
|
31402
|
+
* bootstrapApplication(App, {
|
|
31403
|
+
* providers: [
|
|
31404
|
+
* provideHttpClient(),
|
|
31405
|
+
* {
|
|
31406
|
+
* provide: APP_INITIALIZER,
|
|
31407
|
+
* useFactory: initializeApp,
|
|
31408
|
+
* multi: true,
|
|
31409
|
+
* deps: [HttpClient],
|
|
31410
|
+
* },
|
|
31411
|
+
* ],
|
|
31412
|
+
* });
|
|
31413
|
+
|
|
31414
|
+
* ```
|
|
31415
|
+
*
|
|
31416
|
+
*
|
|
31417
|
+
* It's also possible to configure a multi-provider using `APP_INITIALIZER` token and a function
|
|
31418
|
+
* returning an observable, see an example below. Note: the `HttpClient` in this example is used for
|
|
31419
|
+
* demo purposes to illustrate how the factory function can work with other providers available
|
|
31420
|
+
* through DI.
|
|
31421
|
+
*
|
|
31422
|
+
* ### Example with NgModule-based application
|
|
31423
|
+
* ```
|
|
31424
|
+
* function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
|
|
31425
|
+
* return () => httpClient.get("https://someUrl.com/api/user")
|
|
31426
|
+
* .pipe(
|
|
31427
|
+
* tap(user => { ... })
|
|
31428
|
+
* );
|
|
31429
|
+
* }
|
|
31430
|
+
*
|
|
31431
|
+
* @NgModule({
|
|
31432
|
+
* imports: [BrowserModule, HttpClientModule],
|
|
31433
|
+
* declarations: [AppComponent],
|
|
31434
|
+
* bootstrap: [AppComponent],
|
|
31435
|
+
* providers: [{
|
|
31436
|
+
* provide: APP_INITIALIZER,
|
|
31437
|
+
* useFactory: initializeAppFactory,
|
|
31438
|
+
* deps: [HttpClient],
|
|
31439
|
+
* multi: true
|
|
31440
|
+
* }]
|
|
31441
|
+
* })
|
|
31442
|
+
* export class AppModule {}
|
|
31443
|
+
* ```
|
|
31444
|
+
*
|
|
31445
|
+
* ### Example with standalone application
|
|
31446
|
+
* ```
|
|
31447
|
+
* function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
|
|
31448
|
+
* return () => httpClient.get("https://someUrl.com/api/user")
|
|
31449
|
+
* .pipe(
|
|
31450
|
+
* tap(user => { ... })
|
|
31451
|
+
* );
|
|
31452
|
+
* }
|
|
31453
|
+
*
|
|
31454
|
+
* bootstrapApplication(App, {
|
|
31455
|
+
* providers: [
|
|
31456
|
+
* provideHttpClient(),
|
|
31457
|
+
* {
|
|
31458
|
+
* provide: APP_INITIALIZER,
|
|
31459
|
+
* useFactory: initializeAppFactory,
|
|
31460
|
+
* multi: true,
|
|
31461
|
+
* deps: [HttpClient],
|
|
31462
|
+
* },
|
|
31463
|
+
* ],
|
|
31464
|
+
* });
|
|
31465
|
+
* ```
|
|
31466
|
+
*
|
|
31467
|
+
* @publicApi
|
|
31766
31468
|
*/
|
|
31767
|
-
const
|
|
31469
|
+
const APP_INITIALIZER = new InjectionToken('Application Initializer');
|
|
31768
31470
|
/**
|
|
31769
|
-
*
|
|
31770
|
-
*
|
|
31771
|
-
*
|
|
31772
|
-
* entire class tree-shakeable.
|
|
31471
|
+
* A class that reflects the state of running {@link APP_INITIALIZER} functions.
|
|
31472
|
+
*
|
|
31473
|
+
* @publicApi
|
|
31773
31474
|
*/
|
|
31774
|
-
|
|
31475
|
+
class ApplicationInitStatus {
|
|
31476
|
+
constructor() {
|
|
31477
|
+
this.initialized = false;
|
|
31478
|
+
this.done = false;
|
|
31479
|
+
this.donePromise = new Promise((res, rej) => {
|
|
31480
|
+
this.resolve = res;
|
|
31481
|
+
this.reject = rej;
|
|
31482
|
+
});
|
|
31483
|
+
this.appInits = inject(APP_INITIALIZER, { optional: true }) ?? [];
|
|
31484
|
+
if ((typeof ngDevMode === 'undefined' || ngDevMode) && !Array.isArray(this.appInits)) {
|
|
31485
|
+
throw new RuntimeError(-209 /* RuntimeErrorCode.INVALID_MULTI_PROVIDER */, 'Unexpected type of the `APP_INITIALIZER` token value ' +
|
|
31486
|
+
`(expected an array, but got ${typeof this.appInits}). ` +
|
|
31487
|
+
'Please check that the `APP_INITIALIZER` token is configured as a ' +
|
|
31488
|
+
'`multi: true` provider.');
|
|
31489
|
+
}
|
|
31490
|
+
}
|
|
31491
|
+
/** @internal */
|
|
31492
|
+
runInitializers() {
|
|
31493
|
+
if (this.initialized) {
|
|
31494
|
+
return;
|
|
31495
|
+
}
|
|
31496
|
+
const asyncInitPromises = [];
|
|
31497
|
+
for (const appInits of this.appInits) {
|
|
31498
|
+
const initResult = appInits();
|
|
31499
|
+
if (isPromise(initResult)) {
|
|
31500
|
+
asyncInitPromises.push(initResult);
|
|
31501
|
+
}
|
|
31502
|
+
else if (isSubscribable(initResult)) {
|
|
31503
|
+
const observableAsPromise = new Promise((resolve, reject) => {
|
|
31504
|
+
initResult.subscribe({ complete: resolve, error: reject });
|
|
31505
|
+
});
|
|
31506
|
+
asyncInitPromises.push(observableAsPromise);
|
|
31507
|
+
}
|
|
31508
|
+
}
|
|
31509
|
+
const complete = () => {
|
|
31510
|
+
// @ts-expect-error overwriting a readonly
|
|
31511
|
+
this.done = true;
|
|
31512
|
+
this.resolve();
|
|
31513
|
+
};
|
|
31514
|
+
Promise.all(asyncInitPromises)
|
|
31515
|
+
.then(() => {
|
|
31516
|
+
complete();
|
|
31517
|
+
})
|
|
31518
|
+
.catch(e => {
|
|
31519
|
+
this.reject(e);
|
|
31520
|
+
});
|
|
31521
|
+
if (asyncInitPromises.length === 0) {
|
|
31522
|
+
complete();
|
|
31523
|
+
}
|
|
31524
|
+
this.initialized = true;
|
|
31525
|
+
}
|
|
31526
|
+
static { this.ɵfac = function ApplicationInitStatus_Factory(t) { return new (t || ApplicationInitStatus)(); }; }
|
|
31527
|
+
static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationInitStatus, factory: ApplicationInitStatus.ɵfac, providedIn: 'root' }); }
|
|
31528
|
+
}
|
|
31529
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationInitStatus, [{
|
|
31530
|
+
type: Injectable,
|
|
31531
|
+
args: [{ providedIn: 'root' }]
|
|
31532
|
+
}], () => [], null); })();
|
|
31533
|
+
|
|
31775
31534
|
/**
|
|
31776
31535
|
* A [DI token](guide/glossary#di-token "DI token definition") that provides a set of callbacks to
|
|
31777
31536
|
* be called for every component that is bootstrapped.
|
|
@@ -31849,374 +31608,6 @@ class NgProbeToken {
|
|
|
31849
31608
|
this.token = token;
|
|
31850
31609
|
}
|
|
31851
31610
|
}
|
|
31852
|
-
/**
|
|
31853
|
-
* Creates a platform.
|
|
31854
|
-
* Platforms must be created on launch using this function.
|
|
31855
|
-
*
|
|
31856
|
-
* @publicApi
|
|
31857
|
-
*/
|
|
31858
|
-
function createPlatform(injector) {
|
|
31859
|
-
if (_platformInjector && !_platformInjector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
|
|
31860
|
-
throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, ngDevMode &&
|
|
31861
|
-
'There can be only one platform. Destroy the previous one to create a new one.');
|
|
31862
|
-
}
|
|
31863
|
-
publishDefaultGlobalUtils();
|
|
31864
|
-
publishSignalConfiguration();
|
|
31865
|
-
_platformInjector = injector;
|
|
31866
|
-
const platform = injector.get(PlatformRef);
|
|
31867
|
-
runPlatformInitializers(injector);
|
|
31868
|
-
return platform;
|
|
31869
|
-
}
|
|
31870
|
-
/**
|
|
31871
|
-
* The goal of this function is to bootstrap a platform injector,
|
|
31872
|
-
* but avoid referencing `PlatformRef` class.
|
|
31873
|
-
* This function is needed for bootstrapping a Standalone Component.
|
|
31874
|
-
*/
|
|
31875
|
-
function createOrReusePlatformInjector(providers = []) {
|
|
31876
|
-
// If a platform injector already exists, it means that the platform
|
|
31877
|
-
// is already bootstrapped and no additional actions are required.
|
|
31878
|
-
if (_platformInjector)
|
|
31879
|
-
return _platformInjector;
|
|
31880
|
-
publishDefaultGlobalUtils();
|
|
31881
|
-
// Otherwise, setup a new platform injector and run platform initializers.
|
|
31882
|
-
const injector = createPlatformInjector(providers);
|
|
31883
|
-
_platformInjector = injector;
|
|
31884
|
-
publishSignalConfiguration();
|
|
31885
|
-
runPlatformInitializers(injector);
|
|
31886
|
-
return injector;
|
|
31887
|
-
}
|
|
31888
|
-
function runPlatformInitializers(injector) {
|
|
31889
|
-
const inits = injector.get(PLATFORM_INITIALIZER, null);
|
|
31890
|
-
inits?.forEach((init) => init());
|
|
31891
|
-
}
|
|
31892
|
-
/**
|
|
31893
|
-
* Internal create application API that implements the core application creation logic and optional
|
|
31894
|
-
* bootstrap logic.
|
|
31895
|
-
*
|
|
31896
|
-
* Platforms (such as `platform-browser`) may require different set of application and platform
|
|
31897
|
-
* providers for an application to function correctly. As a result, platforms may use this function
|
|
31898
|
-
* internally and supply the necessary providers during the bootstrap, while exposing
|
|
31899
|
-
* platform-specific APIs as a part of their public API.
|
|
31900
|
-
*
|
|
31901
|
-
* @returns A promise that returns an `ApplicationRef` instance once resolved.
|
|
31902
|
-
*/
|
|
31903
|
-
function internalCreateApplication(config) {
|
|
31904
|
-
try {
|
|
31905
|
-
const { rootComponent, appProviders, platformProviders } = config;
|
|
31906
|
-
if ((typeof ngDevMode === 'undefined' || ngDevMode) && rootComponent !== undefined) {
|
|
31907
|
-
assertStandaloneComponentType(rootComponent);
|
|
31908
|
-
}
|
|
31909
|
-
const platformInjector = createOrReusePlatformInjector(platformProviders);
|
|
31910
|
-
// Create root application injector based on a set of providers configured at the platform
|
|
31911
|
-
// bootstrap level as well as providers passed to the bootstrap call by a user.
|
|
31912
|
-
const allAppProviders = [
|
|
31913
|
-
provideZoneChangeDetection(),
|
|
31914
|
-
...(appProviders || []),
|
|
31915
|
-
];
|
|
31916
|
-
const adapter = new EnvironmentNgModuleRefAdapter({
|
|
31917
|
-
providers: allAppProviders,
|
|
31918
|
-
parent: platformInjector,
|
|
31919
|
-
debugName: (typeof ngDevMode === 'undefined' || ngDevMode) ? 'Environment Injector' : '',
|
|
31920
|
-
// We skip environment initializers because we need to run them inside the NgZone, which
|
|
31921
|
-
// happens after we get the NgZone instance from the Injector.
|
|
31922
|
-
runEnvironmentInitializers: false,
|
|
31923
|
-
});
|
|
31924
|
-
const envInjector = adapter.injector;
|
|
31925
|
-
const ngZone = envInjector.get(NgZone);
|
|
31926
|
-
return ngZone.run(() => {
|
|
31927
|
-
envInjector.resolveInjectorInitializers();
|
|
31928
|
-
const exceptionHandler = envInjector.get(ErrorHandler, null);
|
|
31929
|
-
if ((typeof ngDevMode === 'undefined' || ngDevMode) && !exceptionHandler) {
|
|
31930
|
-
throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, 'No `ErrorHandler` found in the Dependency Injection tree.');
|
|
31931
|
-
}
|
|
31932
|
-
let onErrorSubscription;
|
|
31933
|
-
ngZone.runOutsideAngular(() => {
|
|
31934
|
-
onErrorSubscription = ngZone.onError.subscribe({
|
|
31935
|
-
next: (error) => {
|
|
31936
|
-
exceptionHandler.handleError(error);
|
|
31937
|
-
}
|
|
31938
|
-
});
|
|
31939
|
-
});
|
|
31940
|
-
// If the whole platform is destroyed, invoke the `destroy` method
|
|
31941
|
-
// for all bootstrapped applications as well.
|
|
31942
|
-
const destroyListener = () => envInjector.destroy();
|
|
31943
|
-
const onPlatformDestroyListeners = platformInjector.get(PLATFORM_DESTROY_LISTENERS);
|
|
31944
|
-
onPlatformDestroyListeners.add(destroyListener);
|
|
31945
|
-
envInjector.onDestroy(() => {
|
|
31946
|
-
onErrorSubscription.unsubscribe();
|
|
31947
|
-
onPlatformDestroyListeners.delete(destroyListener);
|
|
31948
|
-
});
|
|
31949
|
-
return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {
|
|
31950
|
-
const initStatus = envInjector.get(ApplicationInitStatus);
|
|
31951
|
-
initStatus.runInitializers();
|
|
31952
|
-
return initStatus.donePromise.then(() => {
|
|
31953
|
-
const localeId = envInjector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
|
|
31954
|
-
setLocaleId(localeId || DEFAULT_LOCALE_ID);
|
|
31955
|
-
const appRef = envInjector.get(ApplicationRef);
|
|
31956
|
-
if (rootComponent !== undefined) {
|
|
31957
|
-
appRef.bootstrap(rootComponent);
|
|
31958
|
-
}
|
|
31959
|
-
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
31960
|
-
const imagePerformanceService = envInjector.get(ImagePerformanceWarning);
|
|
31961
|
-
imagePerformanceService.start();
|
|
31962
|
-
}
|
|
31963
|
-
return appRef;
|
|
31964
|
-
});
|
|
31965
|
-
});
|
|
31966
|
-
});
|
|
31967
|
-
}
|
|
31968
|
-
catch (e) {
|
|
31969
|
-
return Promise.reject(e);
|
|
31970
|
-
}
|
|
31971
|
-
}
|
|
31972
|
-
/**
|
|
31973
|
-
* Creates a factory for a platform. Can be used to provide or override `Providers` specific to
|
|
31974
|
-
* your application's runtime needs, such as `PLATFORM_INITIALIZER` and `PLATFORM_ID`.
|
|
31975
|
-
* @param parentPlatformFactory Another platform factory to modify. Allows you to compose factories
|
|
31976
|
-
* to build up configurations that might be required by different libraries or parts of the
|
|
31977
|
-
* application.
|
|
31978
|
-
* @param name Identifies the new platform factory.
|
|
31979
|
-
* @param providers A set of dependency providers for platforms created with the new factory.
|
|
31980
|
-
*
|
|
31981
|
-
* @publicApi
|
|
31982
|
-
*/
|
|
31983
|
-
function createPlatformFactory(parentPlatformFactory, name, providers = []) {
|
|
31984
|
-
const desc = `Platform: ${name}`;
|
|
31985
|
-
const marker = new InjectionToken(desc);
|
|
31986
|
-
return (extraProviders = []) => {
|
|
31987
|
-
let platform = getPlatform();
|
|
31988
|
-
if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
|
|
31989
|
-
const platformProviders = [
|
|
31990
|
-
...providers, //
|
|
31991
|
-
...extraProviders, //
|
|
31992
|
-
{ provide: marker, useValue: true }
|
|
31993
|
-
];
|
|
31994
|
-
if (parentPlatformFactory) {
|
|
31995
|
-
parentPlatformFactory(platformProviders);
|
|
31996
|
-
}
|
|
31997
|
-
else {
|
|
31998
|
-
createPlatform(createPlatformInjector(platformProviders, desc));
|
|
31999
|
-
}
|
|
32000
|
-
}
|
|
32001
|
-
return assertPlatform(marker);
|
|
32002
|
-
};
|
|
32003
|
-
}
|
|
32004
|
-
/**
|
|
32005
|
-
* Checks that there is currently a platform that contains the given token as a provider.
|
|
32006
|
-
*
|
|
32007
|
-
* @publicApi
|
|
32008
|
-
*/
|
|
32009
|
-
function assertPlatform(requiredToken) {
|
|
32010
|
-
const platform = getPlatform();
|
|
32011
|
-
if (!platform) {
|
|
32012
|
-
throw new RuntimeError(401 /* RuntimeErrorCode.PLATFORM_NOT_FOUND */, ngDevMode && 'No platform exists!');
|
|
32013
|
-
}
|
|
32014
|
-
if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
32015
|
-
!platform.injector.get(requiredToken, null)) {
|
|
32016
|
-
throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, 'A platform with a different configuration has been created. Please destroy it first.');
|
|
32017
|
-
}
|
|
32018
|
-
return platform;
|
|
32019
|
-
}
|
|
32020
|
-
/**
|
|
32021
|
-
* Helper function to create an instance of a platform injector (that maintains the 'platform'
|
|
32022
|
-
* scope).
|
|
32023
|
-
*/
|
|
32024
|
-
function createPlatformInjector(providers = [], name) {
|
|
32025
|
-
return Injector.create({
|
|
32026
|
-
name,
|
|
32027
|
-
providers: [
|
|
32028
|
-
{ provide: INJECTOR_SCOPE, useValue: 'platform' },
|
|
32029
|
-
{ provide: PLATFORM_DESTROY_LISTENERS, useValue: new Set([() => _platformInjector = null]) },
|
|
32030
|
-
...providers
|
|
32031
|
-
],
|
|
32032
|
-
});
|
|
32033
|
-
}
|
|
32034
|
-
/**
|
|
32035
|
-
* Destroys the current Angular platform and all Angular applications on the page.
|
|
32036
|
-
* Destroys all modules and listeners registered with the platform.
|
|
32037
|
-
*
|
|
32038
|
-
* @publicApi
|
|
32039
|
-
*/
|
|
32040
|
-
function destroyPlatform() {
|
|
32041
|
-
getPlatform()?.destroy();
|
|
32042
|
-
}
|
|
32043
|
-
/**
|
|
32044
|
-
* Returns the current platform.
|
|
32045
|
-
*
|
|
32046
|
-
* @publicApi
|
|
32047
|
-
*/
|
|
32048
|
-
function getPlatform() {
|
|
32049
|
-
return _platformInjector?.get(PlatformRef) ?? null;
|
|
32050
|
-
}
|
|
32051
|
-
/**
|
|
32052
|
-
* The Angular platform is the entry point for Angular on a web page.
|
|
32053
|
-
* Each page has exactly one platform. Services (such as reflection) which are common
|
|
32054
|
-
* to every Angular application running on the page are bound in its scope.
|
|
32055
|
-
* A page's platform is initialized implicitly when a platform is created using a platform
|
|
32056
|
-
* factory such as `PlatformBrowser`, or explicitly by calling the `createPlatform()` function.
|
|
32057
|
-
*
|
|
32058
|
-
* @publicApi
|
|
32059
|
-
*/
|
|
32060
|
-
class PlatformRef {
|
|
32061
|
-
/** @internal */
|
|
32062
|
-
constructor(_injector) {
|
|
32063
|
-
this._injector = _injector;
|
|
32064
|
-
this._modules = [];
|
|
32065
|
-
this._destroyListeners = [];
|
|
32066
|
-
this._destroyed = false;
|
|
32067
|
-
}
|
|
32068
|
-
/**
|
|
32069
|
-
* Creates an instance of an `@NgModule` for the given platform.
|
|
32070
|
-
*
|
|
32071
|
-
* @deprecated Passing NgModule factories as the `PlatformRef.bootstrapModuleFactory` function
|
|
32072
|
-
* argument is deprecated. Use the `PlatformRef.bootstrapModule` API instead.
|
|
32073
|
-
*/
|
|
32074
|
-
bootstrapModuleFactory(moduleFactory, options) {
|
|
32075
|
-
// Note: We need to create the NgZone _before_ we instantiate the module,
|
|
32076
|
-
// as instantiating the module creates some providers eagerly.
|
|
32077
|
-
// So we create a mini parent injector that just contains the new NgZone and
|
|
32078
|
-
// pass that as parent to the NgModuleFactory.
|
|
32079
|
-
const ngZone = getNgZone(options?.ngZone, getNgZoneOptions({
|
|
32080
|
-
eventCoalescing: options?.ngZoneEventCoalescing,
|
|
32081
|
-
runCoalescing: options?.ngZoneRunCoalescing
|
|
32082
|
-
}));
|
|
32083
|
-
// Note: Create ngZoneInjector within ngZone.run so that all of the instantiated services are
|
|
32084
|
-
// created within the Angular zone
|
|
32085
|
-
// Do not try to replace ngZone.run with ApplicationRef#run because ApplicationRef would then be
|
|
32086
|
-
// created outside of the Angular zone.
|
|
32087
|
-
return ngZone.run(() => {
|
|
32088
|
-
const moduleRef = createNgModuleRefWithProviders(moduleFactory.moduleType, this.injector, internalProvideZoneChangeDetection(() => ngZone));
|
|
32089
|
-
if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
32090
|
-
moduleRef.injector.get(PROVIDED_NG_ZONE, null) !== null) {
|
|
32091
|
-
throw new RuntimeError(207 /* RuntimeErrorCode.PROVIDER_IN_WRONG_CONTEXT */, '`bootstrapModule` does not support `provideZoneChangeDetection`. Use `BootstrapOptions` instead.');
|
|
32092
|
-
}
|
|
32093
|
-
const exceptionHandler = moduleRef.injector.get(ErrorHandler, null);
|
|
32094
|
-
if ((typeof ngDevMode === 'undefined' || ngDevMode) && exceptionHandler === null) {
|
|
32095
|
-
throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, 'No ErrorHandler. Is platform module (BrowserModule) included?');
|
|
32096
|
-
}
|
|
32097
|
-
ngZone.runOutsideAngular(() => {
|
|
32098
|
-
const subscription = ngZone.onError.subscribe({
|
|
32099
|
-
next: (error) => {
|
|
32100
|
-
exceptionHandler.handleError(error);
|
|
32101
|
-
}
|
|
32102
|
-
});
|
|
32103
|
-
moduleRef.onDestroy(() => {
|
|
32104
|
-
remove(this._modules, moduleRef);
|
|
32105
|
-
subscription.unsubscribe();
|
|
32106
|
-
});
|
|
32107
|
-
});
|
|
32108
|
-
return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {
|
|
32109
|
-
const initStatus = moduleRef.injector.get(ApplicationInitStatus);
|
|
32110
|
-
initStatus.runInitializers();
|
|
32111
|
-
return initStatus.donePromise.then(() => {
|
|
32112
|
-
// If the `LOCALE_ID` provider is defined at bootstrap then we set the value for ivy
|
|
32113
|
-
const localeId = moduleRef.injector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
|
|
32114
|
-
setLocaleId(localeId || DEFAULT_LOCALE_ID);
|
|
32115
|
-
this._moduleDoBootstrap(moduleRef);
|
|
32116
|
-
return moduleRef;
|
|
32117
|
-
});
|
|
32118
|
-
});
|
|
32119
|
-
});
|
|
32120
|
-
}
|
|
32121
|
-
/**
|
|
32122
|
-
* Creates an instance of an `@NgModule` for a given platform.
|
|
32123
|
-
*
|
|
32124
|
-
* @usageNotes
|
|
32125
|
-
* ### Simple Example
|
|
32126
|
-
*
|
|
32127
|
-
* ```typescript
|
|
32128
|
-
* @NgModule({
|
|
32129
|
-
* imports: [BrowserModule]
|
|
32130
|
-
* })
|
|
32131
|
-
* class MyModule {}
|
|
32132
|
-
*
|
|
32133
|
-
* let moduleRef = platformBrowser().bootstrapModule(MyModule);
|
|
32134
|
-
* ```
|
|
32135
|
-
*
|
|
32136
|
-
*/
|
|
32137
|
-
bootstrapModule(moduleType, compilerOptions = []) {
|
|
32138
|
-
const options = optionsReducer({}, compilerOptions);
|
|
32139
|
-
return compileNgModuleFactory(this.injector, options, moduleType)
|
|
32140
|
-
.then(moduleFactory => this.bootstrapModuleFactory(moduleFactory, options));
|
|
32141
|
-
}
|
|
32142
|
-
_moduleDoBootstrap(moduleRef) {
|
|
32143
|
-
const appRef = moduleRef.injector.get(ApplicationRef);
|
|
32144
|
-
if (moduleRef._bootstrapComponents.length > 0) {
|
|
32145
|
-
moduleRef._bootstrapComponents.forEach(f => appRef.bootstrap(f));
|
|
32146
|
-
}
|
|
32147
|
-
else if (moduleRef.instance.ngDoBootstrap) {
|
|
32148
|
-
moduleRef.instance.ngDoBootstrap(appRef);
|
|
32149
|
-
}
|
|
32150
|
-
else {
|
|
32151
|
-
throw new RuntimeError(-403 /* RuntimeErrorCode.BOOTSTRAP_COMPONENTS_NOT_FOUND */, ngDevMode &&
|
|
32152
|
-
`The module ${stringify(moduleRef.instance.constructor)} was bootstrapped, ` +
|
|
32153
|
-
`but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. ` +
|
|
32154
|
-
`Please define one of these.`);
|
|
32155
|
-
}
|
|
32156
|
-
this._modules.push(moduleRef);
|
|
32157
|
-
}
|
|
32158
|
-
/**
|
|
32159
|
-
* Registers a listener to be called when the platform is destroyed.
|
|
32160
|
-
*/
|
|
32161
|
-
onDestroy(callback) {
|
|
32162
|
-
this._destroyListeners.push(callback);
|
|
32163
|
-
}
|
|
32164
|
-
/**
|
|
32165
|
-
* Retrieves the platform {@link Injector}, which is the parent injector for
|
|
32166
|
-
* every Angular application on the page and provides singleton providers.
|
|
32167
|
-
*/
|
|
32168
|
-
get injector() {
|
|
32169
|
-
return this._injector;
|
|
32170
|
-
}
|
|
32171
|
-
/**
|
|
32172
|
-
* Destroys the current Angular platform and all Angular applications on the page.
|
|
32173
|
-
* Destroys all modules and listeners registered with the platform.
|
|
32174
|
-
*/
|
|
32175
|
-
destroy() {
|
|
32176
|
-
if (this._destroyed) {
|
|
32177
|
-
throw new RuntimeError(404 /* RuntimeErrorCode.PLATFORM_ALREADY_DESTROYED */, ngDevMode && 'The platform has already been destroyed!');
|
|
32178
|
-
}
|
|
32179
|
-
this._modules.slice().forEach(module => module.destroy());
|
|
32180
|
-
this._destroyListeners.forEach(listener => listener());
|
|
32181
|
-
const destroyListeners = this._injector.get(PLATFORM_DESTROY_LISTENERS, null);
|
|
32182
|
-
if (destroyListeners) {
|
|
32183
|
-
destroyListeners.forEach(listener => listener());
|
|
32184
|
-
destroyListeners.clear();
|
|
32185
|
-
}
|
|
32186
|
-
this._destroyed = true;
|
|
32187
|
-
}
|
|
32188
|
-
/**
|
|
32189
|
-
* Indicates whether this instance was destroyed.
|
|
32190
|
-
*/
|
|
32191
|
-
get destroyed() {
|
|
32192
|
-
return this._destroyed;
|
|
32193
|
-
}
|
|
32194
|
-
static { this.ɵfac = function PlatformRef_Factory(t) { return new (t || PlatformRef)(ɵɵinject(Injector)); }; }
|
|
32195
|
-
static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: PlatformRef, factory: PlatformRef.ɵfac, providedIn: 'platform' }); }
|
|
32196
|
-
}
|
|
32197
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformRef, [{
|
|
32198
|
-
type: Injectable,
|
|
32199
|
-
args: [{ providedIn: 'platform' }]
|
|
32200
|
-
}], () => [{ type: Injector }], null); })();
|
|
32201
|
-
// Transforms a set of `BootstrapOptions` (supported by the NgModule-based bootstrap APIs) ->
|
|
32202
|
-
// `NgZoneOptions` that are recognized by the NgZone constructor. Passing no options will result in
|
|
32203
|
-
// a set of default options returned.
|
|
32204
|
-
function getNgZoneOptions(options) {
|
|
32205
|
-
return {
|
|
32206
|
-
enableLongStackTrace: typeof ngDevMode === 'undefined' ? false : !!ngDevMode,
|
|
32207
|
-
shouldCoalesceEventChangeDetection: options?.eventCoalescing ?? false,
|
|
32208
|
-
shouldCoalesceRunChangeDetection: options?.runCoalescing ?? false,
|
|
32209
|
-
};
|
|
32210
|
-
}
|
|
32211
|
-
function getNgZone(ngZoneToUse = 'zone.js', options) {
|
|
32212
|
-
if (ngZoneToUse === 'noop') {
|
|
32213
|
-
return new NoopNgZone();
|
|
32214
|
-
}
|
|
32215
|
-
if (ngZoneToUse === 'zone.js') {
|
|
32216
|
-
return new NgZone(options);
|
|
32217
|
-
}
|
|
32218
|
-
return ngZoneToUse;
|
|
32219
|
-
}
|
|
32220
31611
|
function _callAndReportToErrorHandler(errorHandler, ngZone, callback) {
|
|
32221
31612
|
try {
|
|
32222
31613
|
const result = callback();
|
|
@@ -32357,7 +31748,7 @@ class ApplicationRef {
|
|
|
32357
31748
|
* Returns an Observable that indicates when the application is stable or unstable.
|
|
32358
31749
|
*/
|
|
32359
31750
|
this.isStable = inject(InitialRenderPendingTasks)
|
|
32360
|
-
.hasPendingTasks.pipe(switchMap(hasPendingTasks => hasPendingTasks ? of(false) : this.zoneIsStable), distinctUntilChanged()
|
|
31751
|
+
.hasPendingTasks.pipe(switchMap(hasPendingTasks => hasPendingTasks ? of(false) : this.zoneIsStable), distinctUntilChanged());
|
|
32361
31752
|
this._injector = inject(EnvironmentInjector);
|
|
32362
31753
|
}
|
|
32363
31754
|
/**
|
|
@@ -32536,179 +31927,629 @@ class ApplicationRef {
|
|
|
32536
31927
|
}
|
|
32537
31928
|
}
|
|
32538
31929
|
/**
|
|
32539
|
-
* Registers a listener to be called when an instance is destroyed.
|
|
32540
|
-
*
|
|
32541
|
-
* @param callback A callback function to add as a listener.
|
|
32542
|
-
* @returns A function which unregisters a listener.
|
|
31930
|
+
* Registers a listener to be called when an instance is destroyed.
|
|
31931
|
+
*
|
|
31932
|
+
* @param callback A callback function to add as a listener.
|
|
31933
|
+
* @returns A function which unregisters a listener.
|
|
31934
|
+
*/
|
|
31935
|
+
onDestroy(callback) {
|
|
31936
|
+
(typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();
|
|
31937
|
+
this._destroyListeners.push(callback);
|
|
31938
|
+
return () => remove(this._destroyListeners, callback);
|
|
31939
|
+
}
|
|
31940
|
+
/**
|
|
31941
|
+
* Destroys an Angular application represented by this `ApplicationRef`. Calling this function
|
|
31942
|
+
* will destroy the associated environment injectors as well as all the bootstrapped components
|
|
31943
|
+
* with their views.
|
|
31944
|
+
*/
|
|
31945
|
+
destroy() {
|
|
31946
|
+
if (this._destroyed) {
|
|
31947
|
+
throw new RuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, ngDevMode && 'This instance of the `ApplicationRef` has already been destroyed.');
|
|
31948
|
+
}
|
|
31949
|
+
const injector = this._injector;
|
|
31950
|
+
// Check that this injector instance supports destroy operation.
|
|
31951
|
+
if (injector.destroy && !injector.destroyed) {
|
|
31952
|
+
// Destroying an underlying injector will trigger the `ngOnDestroy` lifecycle
|
|
31953
|
+
// hook, which invokes the remaining cleanup actions.
|
|
31954
|
+
injector.destroy();
|
|
31955
|
+
}
|
|
31956
|
+
}
|
|
31957
|
+
/**
|
|
31958
|
+
* Returns the number of attached views.
|
|
31959
|
+
*/
|
|
31960
|
+
get viewCount() {
|
|
31961
|
+
return this._views.length;
|
|
31962
|
+
}
|
|
31963
|
+
warnIfDestroyed() {
|
|
31964
|
+
if ((typeof ngDevMode === 'undefined' || ngDevMode) && this._destroyed) {
|
|
31965
|
+
console.warn(formatRuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, 'This instance of the `ApplicationRef` has already been destroyed.'));
|
|
31966
|
+
}
|
|
31967
|
+
}
|
|
31968
|
+
static { this.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(); }; }
|
|
31969
|
+
static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac, providedIn: 'root' }); }
|
|
31970
|
+
}
|
|
31971
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationRef, [{
|
|
31972
|
+
type: Injectable,
|
|
31973
|
+
args: [{ providedIn: 'root' }]
|
|
31974
|
+
}], null, null); })();
|
|
31975
|
+
function remove(list, el) {
|
|
31976
|
+
const index = list.indexOf(el);
|
|
31977
|
+
if (index > -1) {
|
|
31978
|
+
list.splice(index, 1);
|
|
31979
|
+
}
|
|
31980
|
+
}
|
|
31981
|
+
function _lastDefined(args) {
|
|
31982
|
+
for (let i = args.length - 1; i >= 0; i--) {
|
|
31983
|
+
if (args[i] !== undefined) {
|
|
31984
|
+
return args[i];
|
|
31985
|
+
}
|
|
31986
|
+
}
|
|
31987
|
+
return undefined;
|
|
31988
|
+
}
|
|
31989
|
+
let whenStableStore;
|
|
31990
|
+
/**
|
|
31991
|
+
* Returns a Promise that resolves when the application becomes stable after this method is called
|
|
31992
|
+
* the first time.
|
|
31993
|
+
*/
|
|
31994
|
+
function whenStable(applicationRef) {
|
|
31995
|
+
whenStableStore ??= new WeakMap();
|
|
31996
|
+
const cachedWhenStable = whenStableStore.get(applicationRef);
|
|
31997
|
+
if (cachedWhenStable) {
|
|
31998
|
+
return cachedWhenStable;
|
|
31999
|
+
}
|
|
32000
|
+
const whenStablePromise = applicationRef.isStable.pipe(first((isStable) => isStable)).toPromise().then(() => void 0);
|
|
32001
|
+
whenStableStore.set(applicationRef, whenStablePromise);
|
|
32002
|
+
// Be a good citizen and clean the store `onDestroy` even though we are using `WeakMap`.
|
|
32003
|
+
applicationRef.onDestroy(() => whenStableStore?.delete(applicationRef));
|
|
32004
|
+
return whenStablePromise;
|
|
32005
|
+
}
|
|
32006
|
+
|
|
32007
|
+
class NgZoneChangeDetectionScheduler {
|
|
32008
|
+
constructor() {
|
|
32009
|
+
this.zone = inject(NgZone);
|
|
32010
|
+
this.applicationRef = inject(ApplicationRef);
|
|
32011
|
+
}
|
|
32012
|
+
initialize() {
|
|
32013
|
+
if (this._onMicrotaskEmptySubscription) {
|
|
32014
|
+
return;
|
|
32015
|
+
}
|
|
32016
|
+
this._onMicrotaskEmptySubscription = this.zone.onMicrotaskEmpty.subscribe({
|
|
32017
|
+
next: () => {
|
|
32018
|
+
this.zone.run(() => {
|
|
32019
|
+
this.applicationRef.tick();
|
|
32020
|
+
});
|
|
32021
|
+
}
|
|
32022
|
+
});
|
|
32023
|
+
}
|
|
32024
|
+
ngOnDestroy() {
|
|
32025
|
+
this._onMicrotaskEmptySubscription?.unsubscribe();
|
|
32026
|
+
}
|
|
32027
|
+
static { this.ɵfac = function NgZoneChangeDetectionScheduler_Factory(t) { return new (t || NgZoneChangeDetectionScheduler)(); }; }
|
|
32028
|
+
static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: NgZoneChangeDetectionScheduler, factory: NgZoneChangeDetectionScheduler.ɵfac, providedIn: 'root' }); }
|
|
32029
|
+
}
|
|
32030
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgZoneChangeDetectionScheduler, [{
|
|
32031
|
+
type: Injectable,
|
|
32032
|
+
args: [{ providedIn: 'root' }]
|
|
32033
|
+
}], null, null); })();
|
|
32034
|
+
/**
|
|
32035
|
+
* Internal token used to verify that `provideZoneChangeDetection` is not used
|
|
32036
|
+
* with the bootstrapModule API.
|
|
32037
|
+
*/
|
|
32038
|
+
const PROVIDED_NG_ZONE = new InjectionToken((typeof ngDevMode === 'undefined' || ngDevMode) ? 'provideZoneChangeDetection token' : '');
|
|
32039
|
+
function internalProvideZoneChangeDetection(ngZoneFactory) {
|
|
32040
|
+
return [
|
|
32041
|
+
{ provide: NgZone, useFactory: ngZoneFactory },
|
|
32042
|
+
{
|
|
32043
|
+
provide: ENVIRONMENT_INITIALIZER,
|
|
32044
|
+
multi: true,
|
|
32045
|
+
useFactory: () => {
|
|
32046
|
+
const ngZoneChangeDetectionScheduler = inject(NgZoneChangeDetectionScheduler, { optional: true });
|
|
32047
|
+
if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
32048
|
+
ngZoneChangeDetectionScheduler === null) {
|
|
32049
|
+
throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, `A required Injectable was not found in the dependency injection tree. ` +
|
|
32050
|
+
'If you are bootstrapping an NgModule, make sure that the `BrowserModule` is imported.');
|
|
32051
|
+
}
|
|
32052
|
+
return () => ngZoneChangeDetectionScheduler.initialize();
|
|
32053
|
+
},
|
|
32054
|
+
},
|
|
32055
|
+
{ provide: INTERNAL_APPLICATION_ERROR_HANDLER, useFactory: ngZoneApplicationErrorHandlerFactory },
|
|
32056
|
+
{ provide: ZONE_IS_STABLE_OBSERVABLE, useFactory: isStableFactory },
|
|
32057
|
+
];
|
|
32058
|
+
}
|
|
32059
|
+
function ngZoneApplicationErrorHandlerFactory() {
|
|
32060
|
+
const zone = inject(NgZone);
|
|
32061
|
+
const userErrorHandler = inject(ErrorHandler);
|
|
32062
|
+
return (e) => zone.runOutsideAngular(() => userErrorHandler.handleError(e));
|
|
32063
|
+
}
|
|
32064
|
+
/**
|
|
32065
|
+
* Provides `NgZone`-based change detection for the application bootstrapped using
|
|
32066
|
+
* `bootstrapApplication`.
|
|
32067
|
+
*
|
|
32068
|
+
* `NgZone` is already provided in applications by default. This provider allows you to configure
|
|
32069
|
+
* options like `eventCoalescing` in the `NgZone`.
|
|
32070
|
+
* This provider is not available for `platformBrowser().bootstrapModule`, which uses
|
|
32071
|
+
* `BootstrapOptions` instead.
|
|
32072
|
+
*
|
|
32073
|
+
* @usageNotes
|
|
32074
|
+
* ```typescript
|
|
32075
|
+
* bootstrapApplication(MyApp, {providers: [
|
|
32076
|
+
* provideZoneChangeDetection({eventCoalescing: true}),
|
|
32077
|
+
* ]});
|
|
32078
|
+
* ```
|
|
32079
|
+
*
|
|
32080
|
+
* @publicApi
|
|
32081
|
+
* @see {@link bootstrapApplication}
|
|
32082
|
+
* @see {@link NgZoneOptions}
|
|
32083
|
+
*/
|
|
32084
|
+
function provideZoneChangeDetection(options) {
|
|
32085
|
+
const zoneProviders = internalProvideZoneChangeDetection(() => new NgZone(getNgZoneOptions(options)));
|
|
32086
|
+
return makeEnvironmentProviders([
|
|
32087
|
+
(typeof ngDevMode === 'undefined' || ngDevMode) ? { provide: PROVIDED_NG_ZONE, useValue: true } :
|
|
32088
|
+
[],
|
|
32089
|
+
zoneProviders,
|
|
32090
|
+
]);
|
|
32091
|
+
}
|
|
32092
|
+
// Transforms a set of `BootstrapOptions` (supported by the NgModule-based bootstrap APIs) ->
|
|
32093
|
+
// `NgZoneOptions` that are recognized by the NgZone constructor. Passing no options will result in
|
|
32094
|
+
// a set of default options returned.
|
|
32095
|
+
function getNgZoneOptions(options) {
|
|
32096
|
+
return {
|
|
32097
|
+
enableLongStackTrace: typeof ngDevMode === 'undefined' ? false : !!ngDevMode,
|
|
32098
|
+
shouldCoalesceEventChangeDetection: options?.eventCoalescing ?? false,
|
|
32099
|
+
shouldCoalesceRunChangeDetection: options?.runCoalescing ?? false,
|
|
32100
|
+
};
|
|
32101
|
+
}
|
|
32102
|
+
|
|
32103
|
+
/**
|
|
32104
|
+
* Work out the locale from the potential global properties.
|
|
32105
|
+
*
|
|
32106
|
+
* * Closure Compiler: use `goog.LOCALE`.
|
|
32107
|
+
* * Ivy enabled: use `$localize.locale`
|
|
32108
|
+
*/
|
|
32109
|
+
function getGlobalLocale() {
|
|
32110
|
+
if (typeof ngI18nClosureMode !== 'undefined' && ngI18nClosureMode &&
|
|
32111
|
+
typeof goog !== 'undefined' && goog.LOCALE !== 'en') {
|
|
32112
|
+
// * The default `goog.LOCALE` value is `en`, while Angular used `en-US`.
|
|
32113
|
+
// * In order to preserve backwards compatibility, we use Angular default value over
|
|
32114
|
+
// Closure Compiler's one.
|
|
32115
|
+
return goog.LOCALE;
|
|
32116
|
+
}
|
|
32117
|
+
else {
|
|
32118
|
+
// KEEP `typeof $localize !== 'undefined' && $localize.locale` IN SYNC WITH THE LOCALIZE
|
|
32119
|
+
// COMPILE-TIME INLINER.
|
|
32120
|
+
//
|
|
32121
|
+
// * During compile time inlining of translations the expression will be replaced
|
|
32122
|
+
// with a string literal that is the current locale. Other forms of this expression are not
|
|
32123
|
+
// guaranteed to be replaced.
|
|
32124
|
+
//
|
|
32125
|
+
// * During runtime translation evaluation, the developer is required to set `$localize.locale`
|
|
32126
|
+
// if required, or just to provide their own `LOCALE_ID` provider.
|
|
32127
|
+
return (typeof $localize !== 'undefined' && $localize.locale) || DEFAULT_LOCALE_ID;
|
|
32128
|
+
}
|
|
32129
|
+
}
|
|
32130
|
+
/**
|
|
32131
|
+
* Provide this token to set the locale of your application.
|
|
32132
|
+
* It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,
|
|
32133
|
+
* DecimalPipe and PercentPipe) and by ICU expressions.
|
|
32134
|
+
*
|
|
32135
|
+
* See the [i18n guide](guide/i18n-common-locale-id) for more information.
|
|
32136
|
+
*
|
|
32137
|
+
* @usageNotes
|
|
32138
|
+
* ### Example
|
|
32139
|
+
*
|
|
32140
|
+
* ```typescript
|
|
32141
|
+
* import { LOCALE_ID } from '@angular/core';
|
|
32142
|
+
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
32143
|
+
* import { AppModule } from './app/app.module';
|
|
32144
|
+
*
|
|
32145
|
+
* platformBrowserDynamic().bootstrapModule(AppModule, {
|
|
32146
|
+
* providers: [{provide: LOCALE_ID, useValue: 'en-US' }]
|
|
32147
|
+
* });
|
|
32148
|
+
* ```
|
|
32149
|
+
*
|
|
32150
|
+
* @publicApi
|
|
32151
|
+
*/
|
|
32152
|
+
const LOCALE_ID = new InjectionToken('LocaleId', {
|
|
32153
|
+
providedIn: 'root',
|
|
32154
|
+
factory: () => inject(LOCALE_ID, InjectFlags.Optional | InjectFlags.SkipSelf) || getGlobalLocale(),
|
|
32155
|
+
});
|
|
32156
|
+
/**
|
|
32157
|
+
* Provide this token to set the default currency code your application uses for
|
|
32158
|
+
* CurrencyPipe when there is no currency code passed into it. This is only used by
|
|
32159
|
+
* CurrencyPipe and has no relation to locale currency. Defaults to USD if not configured.
|
|
32160
|
+
*
|
|
32161
|
+
* See the [i18n guide](guide/i18n-common-locale-id) for more information.
|
|
32162
|
+
*
|
|
32163
|
+
* <div class="alert is-helpful">
|
|
32164
|
+
*
|
|
32165
|
+
* **Deprecation notice:**
|
|
32166
|
+
*
|
|
32167
|
+
* The default currency code is currently always `USD` but this is deprecated from v9.
|
|
32168
|
+
*
|
|
32169
|
+
* **In v10 the default currency code will be taken from the current locale.**
|
|
32170
|
+
*
|
|
32171
|
+
* If you need the previous behavior then set it by creating a `DEFAULT_CURRENCY_CODE` provider in
|
|
32172
|
+
* your application `NgModule`:
|
|
32173
|
+
*
|
|
32174
|
+
* ```ts
|
|
32175
|
+
* {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}
|
|
32176
|
+
* ```
|
|
32177
|
+
*
|
|
32178
|
+
* </div>
|
|
32179
|
+
*
|
|
32180
|
+
* @usageNotes
|
|
32181
|
+
* ### Example
|
|
32182
|
+
*
|
|
32183
|
+
* ```typescript
|
|
32184
|
+
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
32185
|
+
* import { AppModule } from './app/app.module';
|
|
32186
|
+
*
|
|
32187
|
+
* platformBrowserDynamic().bootstrapModule(AppModule, {
|
|
32188
|
+
* providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }]
|
|
32189
|
+
* });
|
|
32190
|
+
* ```
|
|
32191
|
+
*
|
|
32192
|
+
* @publicApi
|
|
32193
|
+
*/
|
|
32194
|
+
const DEFAULT_CURRENCY_CODE = new InjectionToken('DefaultCurrencyCode', {
|
|
32195
|
+
providedIn: 'root',
|
|
32196
|
+
factory: () => USD_CURRENCY_CODE,
|
|
32197
|
+
});
|
|
32198
|
+
/**
|
|
32199
|
+
* Use this token at bootstrap to provide the content of your translation file (`xtb`,
|
|
32200
|
+
* `xlf` or `xlf2`) when you want to translate your application in another language.
|
|
32201
|
+
*
|
|
32202
|
+
* See the [i18n guide](guide/i18n-common-merge) for more information.
|
|
32203
|
+
*
|
|
32204
|
+
* @usageNotes
|
|
32205
|
+
* ### Example
|
|
32206
|
+
*
|
|
32207
|
+
* ```typescript
|
|
32208
|
+
* import { TRANSLATIONS } from '@angular/core';
|
|
32209
|
+
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
32210
|
+
* import { AppModule } from './app/app.module';
|
|
32211
|
+
*
|
|
32212
|
+
* // content of your translation file
|
|
32213
|
+
* const translations = '....';
|
|
32214
|
+
*
|
|
32215
|
+
* platformBrowserDynamic().bootstrapModule(AppModule, {
|
|
32216
|
+
* providers: [{provide: TRANSLATIONS, useValue: translations }]
|
|
32217
|
+
* });
|
|
32218
|
+
* ```
|
|
32219
|
+
*
|
|
32220
|
+
* @publicApi
|
|
32221
|
+
*/
|
|
32222
|
+
const TRANSLATIONS = new InjectionToken('Translations');
|
|
32223
|
+
/**
|
|
32224
|
+
* Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`,
|
|
32225
|
+
* `xlf` or `xlf2`.
|
|
32226
|
+
*
|
|
32227
|
+
* See the [i18n guide](guide/i18n-common-merge) for more information.
|
|
32228
|
+
*
|
|
32229
|
+
* @usageNotes
|
|
32230
|
+
* ### Example
|
|
32231
|
+
*
|
|
32232
|
+
* ```typescript
|
|
32233
|
+
* import { TRANSLATIONS_FORMAT } from '@angular/core';
|
|
32234
|
+
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
32235
|
+
* import { AppModule } from './app/app.module';
|
|
32236
|
+
*
|
|
32237
|
+
* platformBrowserDynamic().bootstrapModule(AppModule, {
|
|
32238
|
+
* providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]
|
|
32239
|
+
* });
|
|
32240
|
+
* ```
|
|
32241
|
+
*
|
|
32242
|
+
* @publicApi
|
|
32243
|
+
*/
|
|
32244
|
+
const TRANSLATIONS_FORMAT = new InjectionToken('TranslationsFormat');
|
|
32245
|
+
/**
|
|
32246
|
+
* Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy
|
|
32247
|
+
* that the compiler should use in case of missing translations:
|
|
32248
|
+
* - Error: throw if you have missing translations.
|
|
32249
|
+
* - Warning (default): show a warning in the console and/or shell.
|
|
32250
|
+
* - Ignore: do nothing.
|
|
32251
|
+
*
|
|
32252
|
+
* See the [i18n guide](guide/i18n-common-merge#report-missing-translations) for more information.
|
|
32253
|
+
*
|
|
32254
|
+
* @usageNotes
|
|
32255
|
+
* ### Example
|
|
32256
|
+
* ```typescript
|
|
32257
|
+
* import { MissingTranslationStrategy } from '@angular/core';
|
|
32258
|
+
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
32259
|
+
* import { AppModule } from './app/app.module';
|
|
32260
|
+
*
|
|
32261
|
+
* platformBrowserDynamic().bootstrapModule(AppModule, {
|
|
32262
|
+
* missingTranslation: MissingTranslationStrategy.Error
|
|
32263
|
+
* });
|
|
32264
|
+
* ```
|
|
32265
|
+
*
|
|
32266
|
+
* @publicApi
|
|
32267
|
+
*/
|
|
32268
|
+
var MissingTranslationStrategy;
|
|
32269
|
+
(function (MissingTranslationStrategy) {
|
|
32270
|
+
MissingTranslationStrategy[MissingTranslationStrategy["Error"] = 0] = "Error";
|
|
32271
|
+
MissingTranslationStrategy[MissingTranslationStrategy["Warning"] = 1] = "Warning";
|
|
32272
|
+
MissingTranslationStrategy[MissingTranslationStrategy["Ignore"] = 2] = "Ignore";
|
|
32273
|
+
})(MissingTranslationStrategy || (MissingTranslationStrategy = {}));
|
|
32274
|
+
|
|
32275
|
+
/**
|
|
32276
|
+
* Internal token that allows to register extra callbacks that should be invoked during the
|
|
32277
|
+
* `PlatformRef.destroy` operation. This token is needed to avoid a direct reference to the
|
|
32278
|
+
* `PlatformRef` class (i.e. register the callback via `PlatformRef.onDestroy`), thus making the
|
|
32279
|
+
* entire class tree-shakeable.
|
|
32280
|
+
*/
|
|
32281
|
+
const PLATFORM_DESTROY_LISTENERS = new InjectionToken('PlatformDestroyListeners');
|
|
32282
|
+
/**
|
|
32283
|
+
* The Angular platform is the entry point for Angular on a web page.
|
|
32284
|
+
* Each page has exactly one platform. Services (such as reflection) which are common
|
|
32285
|
+
* to every Angular application running on the page are bound in its scope.
|
|
32286
|
+
* A page's platform is initialized implicitly when a platform is created using a platform
|
|
32287
|
+
* factory such as `PlatformBrowser`, or explicitly by calling the `createPlatform()` function.
|
|
32288
|
+
*
|
|
32289
|
+
* @publicApi
|
|
32290
|
+
*/
|
|
32291
|
+
class PlatformRef {
|
|
32292
|
+
/** @internal */
|
|
32293
|
+
constructor(_injector) {
|
|
32294
|
+
this._injector = _injector;
|
|
32295
|
+
this._modules = [];
|
|
32296
|
+
this._destroyListeners = [];
|
|
32297
|
+
this._destroyed = false;
|
|
32298
|
+
}
|
|
32299
|
+
/**
|
|
32300
|
+
* Creates an instance of an `@NgModule` for the given platform.
|
|
32301
|
+
*
|
|
32302
|
+
* @deprecated Passing NgModule factories as the `PlatformRef.bootstrapModuleFactory` function
|
|
32303
|
+
* argument is deprecated. Use the `PlatformRef.bootstrapModule` API instead.
|
|
32304
|
+
*/
|
|
32305
|
+
bootstrapModuleFactory(moduleFactory, options) {
|
|
32306
|
+
// Note: We need to create the NgZone _before_ we instantiate the module,
|
|
32307
|
+
// as instantiating the module creates some providers eagerly.
|
|
32308
|
+
// So we create a mini parent injector that just contains the new NgZone and
|
|
32309
|
+
// pass that as parent to the NgModuleFactory.
|
|
32310
|
+
const ngZone = getNgZone(options?.ngZone, getNgZoneOptions({
|
|
32311
|
+
eventCoalescing: options?.ngZoneEventCoalescing,
|
|
32312
|
+
runCoalescing: options?.ngZoneRunCoalescing
|
|
32313
|
+
}));
|
|
32314
|
+
// Note: Create ngZoneInjector within ngZone.run so that all of the instantiated services are
|
|
32315
|
+
// created within the Angular zone
|
|
32316
|
+
// Do not try to replace ngZone.run with ApplicationRef#run because ApplicationRef would then be
|
|
32317
|
+
// created outside of the Angular zone.
|
|
32318
|
+
return ngZone.run(() => {
|
|
32319
|
+
const moduleRef = createNgModuleRefWithProviders(moduleFactory.moduleType, this.injector, internalProvideZoneChangeDetection(() => ngZone));
|
|
32320
|
+
if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
32321
|
+
moduleRef.injector.get(PROVIDED_NG_ZONE, null) !== null) {
|
|
32322
|
+
throw new RuntimeError(207 /* RuntimeErrorCode.PROVIDER_IN_WRONG_CONTEXT */, '`bootstrapModule` does not support `provideZoneChangeDetection`. Use `BootstrapOptions` instead.');
|
|
32323
|
+
}
|
|
32324
|
+
const exceptionHandler = moduleRef.injector.get(ErrorHandler, null);
|
|
32325
|
+
if ((typeof ngDevMode === 'undefined' || ngDevMode) && exceptionHandler === null) {
|
|
32326
|
+
throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, 'No ErrorHandler. Is platform module (BrowserModule) included?');
|
|
32327
|
+
}
|
|
32328
|
+
ngZone.runOutsideAngular(() => {
|
|
32329
|
+
const subscription = ngZone.onError.subscribe({
|
|
32330
|
+
next: (error) => {
|
|
32331
|
+
exceptionHandler.handleError(error);
|
|
32332
|
+
}
|
|
32333
|
+
});
|
|
32334
|
+
moduleRef.onDestroy(() => {
|
|
32335
|
+
remove(this._modules, moduleRef);
|
|
32336
|
+
subscription.unsubscribe();
|
|
32337
|
+
});
|
|
32338
|
+
});
|
|
32339
|
+
return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {
|
|
32340
|
+
const initStatus = moduleRef.injector.get(ApplicationInitStatus);
|
|
32341
|
+
initStatus.runInitializers();
|
|
32342
|
+
return initStatus.donePromise.then(() => {
|
|
32343
|
+
// If the `LOCALE_ID` provider is defined at bootstrap then we set the value for ivy
|
|
32344
|
+
const localeId = moduleRef.injector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
|
|
32345
|
+
setLocaleId(localeId || DEFAULT_LOCALE_ID);
|
|
32346
|
+
this._moduleDoBootstrap(moduleRef);
|
|
32347
|
+
return moduleRef;
|
|
32348
|
+
});
|
|
32349
|
+
});
|
|
32350
|
+
});
|
|
32351
|
+
}
|
|
32352
|
+
/**
|
|
32353
|
+
* Creates an instance of an `@NgModule` for a given platform.
|
|
32354
|
+
*
|
|
32355
|
+
* @usageNotes
|
|
32356
|
+
* ### Simple Example
|
|
32357
|
+
*
|
|
32358
|
+
* ```typescript
|
|
32359
|
+
* @NgModule({
|
|
32360
|
+
* imports: [BrowserModule]
|
|
32361
|
+
* })
|
|
32362
|
+
* class MyModule {}
|
|
32363
|
+
*
|
|
32364
|
+
* let moduleRef = platformBrowser().bootstrapModule(MyModule);
|
|
32365
|
+
* ```
|
|
32366
|
+
*
|
|
32367
|
+
*/
|
|
32368
|
+
bootstrapModule(moduleType, compilerOptions = []) {
|
|
32369
|
+
const options = optionsReducer({}, compilerOptions);
|
|
32370
|
+
return compileNgModuleFactory(this.injector, options, moduleType)
|
|
32371
|
+
.then(moduleFactory => this.bootstrapModuleFactory(moduleFactory, options));
|
|
32372
|
+
}
|
|
32373
|
+
_moduleDoBootstrap(moduleRef) {
|
|
32374
|
+
const appRef = moduleRef.injector.get(ApplicationRef);
|
|
32375
|
+
if (moduleRef._bootstrapComponents.length > 0) {
|
|
32376
|
+
moduleRef._bootstrapComponents.forEach(f => appRef.bootstrap(f));
|
|
32377
|
+
}
|
|
32378
|
+
else if (moduleRef.instance.ngDoBootstrap) {
|
|
32379
|
+
moduleRef.instance.ngDoBootstrap(appRef);
|
|
32380
|
+
}
|
|
32381
|
+
else {
|
|
32382
|
+
throw new RuntimeError(-403 /* RuntimeErrorCode.BOOTSTRAP_COMPONENTS_NOT_FOUND */, ngDevMode &&
|
|
32383
|
+
`The module ${stringify(moduleRef.instance.constructor)} was bootstrapped, ` +
|
|
32384
|
+
`but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. ` +
|
|
32385
|
+
`Please define one of these.`);
|
|
32386
|
+
}
|
|
32387
|
+
this._modules.push(moduleRef);
|
|
32388
|
+
}
|
|
32389
|
+
/**
|
|
32390
|
+
* Registers a listener to be called when the platform is destroyed.
|
|
32543
32391
|
*/
|
|
32544
32392
|
onDestroy(callback) {
|
|
32545
|
-
(typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();
|
|
32546
32393
|
this._destroyListeners.push(callback);
|
|
32547
|
-
return () => remove(this._destroyListeners, callback);
|
|
32548
32394
|
}
|
|
32549
32395
|
/**
|
|
32550
|
-
*
|
|
32551
|
-
*
|
|
32552
|
-
|
|
32396
|
+
* Retrieves the platform {@link Injector}, which is the parent injector for
|
|
32397
|
+
* every Angular application on the page and provides singleton providers.
|
|
32398
|
+
*/
|
|
32399
|
+
get injector() {
|
|
32400
|
+
return this._injector;
|
|
32401
|
+
}
|
|
32402
|
+
/**
|
|
32403
|
+
* Destroys the current Angular platform and all Angular applications on the page.
|
|
32404
|
+
* Destroys all modules and listeners registered with the platform.
|
|
32553
32405
|
*/
|
|
32554
32406
|
destroy() {
|
|
32555
32407
|
if (this._destroyed) {
|
|
32556
|
-
throw new RuntimeError(
|
|
32408
|
+
throw new RuntimeError(404 /* RuntimeErrorCode.PLATFORM_ALREADY_DESTROYED */, ngDevMode && 'The platform has already been destroyed!');
|
|
32557
32409
|
}
|
|
32558
|
-
|
|
32559
|
-
|
|
32560
|
-
|
|
32561
|
-
|
|
32562
|
-
|
|
32563
|
-
|
|
32410
|
+
this._modules.slice().forEach(module => module.destroy());
|
|
32411
|
+
this._destroyListeners.forEach(listener => listener());
|
|
32412
|
+
const destroyListeners = this._injector.get(PLATFORM_DESTROY_LISTENERS, null);
|
|
32413
|
+
if (destroyListeners) {
|
|
32414
|
+
destroyListeners.forEach(listener => listener());
|
|
32415
|
+
destroyListeners.clear();
|
|
32564
32416
|
}
|
|
32417
|
+
this._destroyed = true;
|
|
32565
32418
|
}
|
|
32566
32419
|
/**
|
|
32567
|
-
*
|
|
32420
|
+
* Indicates whether this instance was destroyed.
|
|
32568
32421
|
*/
|
|
32569
|
-
get
|
|
32570
|
-
return this.
|
|
32571
|
-
}
|
|
32572
|
-
warnIfDestroyed() {
|
|
32573
|
-
if ((typeof ngDevMode === 'undefined' || ngDevMode) && this._destroyed) {
|
|
32574
|
-
console.warn(formatRuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, 'This instance of the `ApplicationRef` has already been destroyed.'));
|
|
32575
|
-
}
|
|
32422
|
+
get destroyed() {
|
|
32423
|
+
return this._destroyed;
|
|
32576
32424
|
}
|
|
32577
|
-
static { this.ɵfac = function
|
|
32578
|
-
static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token:
|
|
32425
|
+
static { this.ɵfac = function PlatformRef_Factory(t) { return new (t || PlatformRef)(ɵɵinject(Injector)); }; }
|
|
32426
|
+
static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: PlatformRef, factory: PlatformRef.ɵfac, providedIn: 'platform' }); }
|
|
32579
32427
|
}
|
|
32580
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(
|
|
32428
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformRef, [{
|
|
32581
32429
|
type: Injectable,
|
|
32582
|
-
args: [{ providedIn: '
|
|
32583
|
-
}],
|
|
32584
|
-
|
|
32585
|
-
|
|
32586
|
-
|
|
32587
|
-
|
|
32430
|
+
args: [{ providedIn: 'platform' }]
|
|
32431
|
+
}], () => [{ type: Injector }], null); })();
|
|
32432
|
+
|
|
32433
|
+
let _platformInjector = null;
|
|
32434
|
+
/**
|
|
32435
|
+
* Internal token to indicate whether having multiple bootstrapped platform should be allowed (only
|
|
32436
|
+
* one bootstrapped platform is allowed by default). This token helps to support SSR scenarios.
|
|
32437
|
+
*/
|
|
32438
|
+
const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');
|
|
32439
|
+
/**
|
|
32440
|
+
* Creates a platform.
|
|
32441
|
+
* Platforms must be created on launch using this function.
|
|
32442
|
+
*
|
|
32443
|
+
* @publicApi
|
|
32444
|
+
*/
|
|
32445
|
+
function createPlatform(injector) {
|
|
32446
|
+
if (_platformInjector && !_platformInjector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
|
|
32447
|
+
throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, ngDevMode &&
|
|
32448
|
+
'There can be only one platform. Destroy the previous one to create a new one.');
|
|
32588
32449
|
}
|
|
32450
|
+
publishDefaultGlobalUtils();
|
|
32451
|
+
publishSignalConfiguration();
|
|
32452
|
+
_platformInjector = injector;
|
|
32453
|
+
const platform = injector.get(PlatformRef);
|
|
32454
|
+
runPlatformInitializers(injector);
|
|
32455
|
+
return platform;
|
|
32589
32456
|
}
|
|
32590
|
-
|
|
32591
|
-
|
|
32592
|
-
|
|
32593
|
-
|
|
32457
|
+
/**
|
|
32458
|
+
* Creates a factory for a platform. Can be used to provide or override `Providers` specific to
|
|
32459
|
+
* your application's runtime needs, such as `PLATFORM_INITIALIZER` and `PLATFORM_ID`.
|
|
32460
|
+
* @param parentPlatformFactory Another platform factory to modify. Allows you to compose factories
|
|
32461
|
+
* to build up configurations that might be required by different libraries or parts of the
|
|
32462
|
+
* application.
|
|
32463
|
+
* @param name Identifies the new platform factory.
|
|
32464
|
+
* @param providers A set of dependency providers for platforms created with the new factory.
|
|
32465
|
+
*
|
|
32466
|
+
* @publicApi
|
|
32467
|
+
*/
|
|
32468
|
+
function createPlatformFactory(parentPlatformFactory, name, providers = []) {
|
|
32469
|
+
const desc = `Platform: ${name}`;
|
|
32470
|
+
const marker = new InjectionToken(desc);
|
|
32471
|
+
return (extraProviders = []) => {
|
|
32472
|
+
let platform = getPlatform();
|
|
32473
|
+
if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
|
|
32474
|
+
const platformProviders = [...providers, ...extraProviders, { provide: marker, useValue: true }];
|
|
32475
|
+
if (parentPlatformFactory) {
|
|
32476
|
+
parentPlatformFactory(platformProviders);
|
|
32477
|
+
}
|
|
32478
|
+
else {
|
|
32479
|
+
createPlatform(createPlatformInjector(platformProviders, desc));
|
|
32480
|
+
}
|
|
32594
32481
|
}
|
|
32595
|
-
|
|
32596
|
-
|
|
32482
|
+
return assertPlatform(marker);
|
|
32483
|
+
};
|
|
32597
32484
|
}
|
|
32598
32485
|
/**
|
|
32599
|
-
*
|
|
32600
|
-
*
|
|
32601
|
-
* `NgZone` is provided by default today so the default (and only) implementation for this
|
|
32602
|
-
* is calling `ErrorHandler.handleError` outside of the Angular zone.
|
|
32486
|
+
* Helper function to create an instance of a platform injector (that maintains the 'platform'
|
|
32487
|
+
* scope).
|
|
32603
32488
|
*/
|
|
32604
|
-
|
|
32605
|
-
|
|
32606
|
-
|
|
32607
|
-
|
|
32608
|
-
|
|
32609
|
-
|
|
32610
|
-
|
|
32611
|
-
|
|
32612
|
-
|
|
32613
|
-
const userErrorHandler = inject(ErrorHandler);
|
|
32614
|
-
return (e) => zone.runOutsideAngular(() => userErrorHandler.handleError(e));
|
|
32489
|
+
function createPlatformInjector(providers = [], name) {
|
|
32490
|
+
return Injector.create({
|
|
32491
|
+
name,
|
|
32492
|
+
providers: [
|
|
32493
|
+
{ provide: INJECTOR_SCOPE, useValue: 'platform' },
|
|
32494
|
+
{ provide: PLATFORM_DESTROY_LISTENERS, useValue: new Set([() => _platformInjector = null]) },
|
|
32495
|
+
...providers
|
|
32496
|
+
],
|
|
32497
|
+
});
|
|
32615
32498
|
}
|
|
32616
|
-
|
|
32617
|
-
|
|
32618
|
-
|
|
32619
|
-
|
|
32620
|
-
|
|
32621
|
-
|
|
32622
|
-
|
|
32623
|
-
|
|
32624
|
-
|
|
32625
|
-
this._onMicrotaskEmptySubscription = this.zone.onMicrotaskEmpty.subscribe({
|
|
32626
|
-
next: () => {
|
|
32627
|
-
this.zone.run(() => {
|
|
32628
|
-
this.applicationRef.tick();
|
|
32629
|
-
});
|
|
32630
|
-
}
|
|
32631
|
-
});
|
|
32499
|
+
/**
|
|
32500
|
+
* Checks that there is currently a platform that contains the given token as a provider.
|
|
32501
|
+
*
|
|
32502
|
+
* @publicApi
|
|
32503
|
+
*/
|
|
32504
|
+
function assertPlatform(requiredToken) {
|
|
32505
|
+
const platform = getPlatform();
|
|
32506
|
+
if (!platform) {
|
|
32507
|
+
throw new RuntimeError(401 /* RuntimeErrorCode.PLATFORM_NOT_FOUND */, ngDevMode && 'No platform exists!');
|
|
32632
32508
|
}
|
|
32633
|
-
|
|
32634
|
-
|
|
32509
|
+
if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
32510
|
+
!platform.injector.get(requiredToken, null)) {
|
|
32511
|
+
throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, 'A platform with a different configuration has been created. Please destroy it first.');
|
|
32635
32512
|
}
|
|
32636
|
-
|
|
32637
|
-
static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: NgZoneChangeDetectionScheduler, factory: NgZoneChangeDetectionScheduler.ɵfac, providedIn: 'root' }); }
|
|
32513
|
+
return platform;
|
|
32638
32514
|
}
|
|
32639
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgZoneChangeDetectionScheduler, [{
|
|
32640
|
-
type: Injectable,
|
|
32641
|
-
args: [{ providedIn: 'root' }]
|
|
32642
|
-
}], null, null); })();
|
|
32643
32515
|
/**
|
|
32644
|
-
*
|
|
32645
|
-
*
|
|
32516
|
+
* Returns the current platform.
|
|
32517
|
+
*
|
|
32518
|
+
* @publicApi
|
|
32646
32519
|
*/
|
|
32647
|
-
|
|
32648
|
-
|
|
32649
|
-
return [
|
|
32650
|
-
{ provide: NgZone, useFactory: ngZoneFactory },
|
|
32651
|
-
{
|
|
32652
|
-
provide: ENVIRONMENT_INITIALIZER,
|
|
32653
|
-
multi: true,
|
|
32654
|
-
useFactory: () => {
|
|
32655
|
-
const ngZoneChangeDetectionScheduler = inject(NgZoneChangeDetectionScheduler, { optional: true });
|
|
32656
|
-
if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
32657
|
-
ngZoneChangeDetectionScheduler === null) {
|
|
32658
|
-
throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, `A required Injectable was not found in the dependency injection tree. ` +
|
|
32659
|
-
'If you are bootstrapping an NgModule, make sure that the `BrowserModule` is imported.');
|
|
32660
|
-
}
|
|
32661
|
-
return () => ngZoneChangeDetectionScheduler.initialize();
|
|
32662
|
-
},
|
|
32663
|
-
},
|
|
32664
|
-
{ provide: INTERNAL_APPLICATION_ERROR_HANDLER, useFactory: ngZoneApplicationErrorHandlerFactory },
|
|
32665
|
-
{ provide: ZONE_IS_STABLE_OBSERVABLE, useFactory: isStableFactory },
|
|
32666
|
-
];
|
|
32520
|
+
function getPlatform() {
|
|
32521
|
+
return _platformInjector?.get(PlatformRef) ?? null;
|
|
32667
32522
|
}
|
|
32668
32523
|
/**
|
|
32669
|
-
*
|
|
32670
|
-
*
|
|
32671
|
-
*
|
|
32672
|
-
* `NgZone` is already provided in applications by default. This provider allows you to configure
|
|
32673
|
-
* options like `eventCoalescing` in the `NgZone`.
|
|
32674
|
-
* This provider is not available for `platformBrowser().bootstrapModule`, which uses
|
|
32675
|
-
* `BootstrapOptions` instead.
|
|
32676
|
-
*
|
|
32677
|
-
* @usageNotes
|
|
32678
|
-
* ```typescript
|
|
32679
|
-
* bootstrapApplication(MyApp, {providers: [
|
|
32680
|
-
* provideZoneChangeDetection({eventCoalescing: true}),
|
|
32681
|
-
* ]});
|
|
32682
|
-
* ```
|
|
32524
|
+
* Destroys the current Angular platform and all Angular applications on the page.
|
|
32525
|
+
* Destroys all modules and listeners registered with the platform.
|
|
32683
32526
|
*
|
|
32684
32527
|
* @publicApi
|
|
32685
|
-
* @see {@link bootstrapApplication}
|
|
32686
|
-
* @see {@link NgZoneOptions}
|
|
32687
32528
|
*/
|
|
32688
|
-
function
|
|
32689
|
-
|
|
32690
|
-
return makeEnvironmentProviders([
|
|
32691
|
-
(typeof ngDevMode === 'undefined' || ngDevMode) ? { provide: PROVIDED_NG_ZONE, useValue: true } :
|
|
32692
|
-
[],
|
|
32693
|
-
zoneProviders,
|
|
32694
|
-
]);
|
|
32529
|
+
function destroyPlatform() {
|
|
32530
|
+
getPlatform()?.destroy();
|
|
32695
32531
|
}
|
|
32696
|
-
let whenStableStore;
|
|
32697
32532
|
/**
|
|
32698
|
-
*
|
|
32699
|
-
*
|
|
32533
|
+
* The goal of this function is to bootstrap a platform injector,
|
|
32534
|
+
* but avoid referencing `PlatformRef` class.
|
|
32535
|
+
* This function is needed for bootstrapping a Standalone Component.
|
|
32700
32536
|
*/
|
|
32701
|
-
function
|
|
32702
|
-
|
|
32703
|
-
|
|
32704
|
-
if (
|
|
32705
|
-
return
|
|
32706
|
-
|
|
32707
|
-
|
|
32708
|
-
|
|
32709
|
-
|
|
32710
|
-
|
|
32711
|
-
|
|
32537
|
+
function createOrReusePlatformInjector(providers = []) {
|
|
32538
|
+
// If a platform injector already exists, it means that the platform
|
|
32539
|
+
// is already bootstrapped and no additional actions are required.
|
|
32540
|
+
if (_platformInjector)
|
|
32541
|
+
return _platformInjector;
|
|
32542
|
+
publishDefaultGlobalUtils();
|
|
32543
|
+
// Otherwise, setup a new platform injector and run platform initializers.
|
|
32544
|
+
const injector = createPlatformInjector(providers);
|
|
32545
|
+
_platformInjector = injector;
|
|
32546
|
+
publishSignalConfiguration();
|
|
32547
|
+
runPlatformInitializers(injector);
|
|
32548
|
+
return injector;
|
|
32549
|
+
}
|
|
32550
|
+
function runPlatformInitializers(injector) {
|
|
32551
|
+
const inits = injector.get(PLATFORM_INITIALIZER, null);
|
|
32552
|
+
inits?.forEach((init) => init());
|
|
32712
32553
|
}
|
|
32713
32554
|
|
|
32714
32555
|
/**
|
|
@@ -33868,14 +33709,7 @@ function signalSetFn(node, newValue) {
|
|
|
33868
33709
|
if (!producerUpdatesAllowed()) {
|
|
33869
33710
|
throwInvalidWriteToSignalError();
|
|
33870
33711
|
}
|
|
33871
|
-
|
|
33872
|
-
if (Object.is(value, newValue)) {
|
|
33873
|
-
if (typeof ngDevMode !== 'undefined' && ngDevMode && !node.equal(value, newValue)) {
|
|
33874
|
-
console.warn('Signal value equality implementations should always return `true` for' +
|
|
33875
|
-
' values that are the same according to `Object.is` but returned `false` instead.');
|
|
33876
|
-
}
|
|
33877
|
-
}
|
|
33878
|
-
else if (!node.equal(value, newValue)) {
|
|
33712
|
+
if (!node.equal(node.value, newValue)) {
|
|
33879
33713
|
node.value = newValue;
|
|
33880
33714
|
signalValueChanged(node);
|
|
33881
33715
|
}
|
|
@@ -33989,6 +33823,244 @@ function setAlternateWeakRefImpl(impl) {
|
|
|
33989
33823
|
// TODO: remove this function
|
|
33990
33824
|
}
|
|
33991
33825
|
|
|
33826
|
+
// A delay in milliseconds before the scan is run after onLoad, to avoid any
|
|
33827
|
+
// potential race conditions with other LCP-related functions. This delay
|
|
33828
|
+
// happens outside of the main JavaScript execution and will only effect the timing
|
|
33829
|
+
// on when the warning becomes visible in the console.
|
|
33830
|
+
const SCAN_DELAY = 200;
|
|
33831
|
+
const OVERSIZED_IMAGE_TOLERANCE = 1200;
|
|
33832
|
+
class ImagePerformanceWarning {
|
|
33833
|
+
constructor() {
|
|
33834
|
+
// Map of full image URLs -> original `ngSrc` values.
|
|
33835
|
+
this.window = null;
|
|
33836
|
+
this.observer = null;
|
|
33837
|
+
this.options = inject(IMAGE_CONFIG);
|
|
33838
|
+
this.ngZone = inject(NgZone);
|
|
33839
|
+
}
|
|
33840
|
+
start() {
|
|
33841
|
+
if (typeof PerformanceObserver === 'undefined' ||
|
|
33842
|
+
(this.options?.disableImageSizeWarning && this.options?.disableImageLazyLoadWarning)) {
|
|
33843
|
+
return;
|
|
33844
|
+
}
|
|
33845
|
+
this.observer = this.initPerformanceObserver();
|
|
33846
|
+
const doc = getDocument();
|
|
33847
|
+
const win = doc.defaultView;
|
|
33848
|
+
if (typeof win !== 'undefined') {
|
|
33849
|
+
this.window = win;
|
|
33850
|
+
// Wait to avoid race conditions where LCP image triggers
|
|
33851
|
+
// load event before it's recorded by the performance observer
|
|
33852
|
+
const waitToScan = () => {
|
|
33853
|
+
setTimeout(this.scanImages.bind(this), SCAN_DELAY);
|
|
33854
|
+
};
|
|
33855
|
+
// Angular doesn't have to run change detection whenever any asynchronous tasks are invoked in
|
|
33856
|
+
// the scope of this functionality.
|
|
33857
|
+
this.ngZone.runOutsideAngular(() => {
|
|
33858
|
+
// Consider the case when the application is created and destroyed multiple times.
|
|
33859
|
+
// Typically, applications are created instantly once the page is loaded, and the
|
|
33860
|
+
// `window.load` listener is always triggered. However, the `window.load` event will never
|
|
33861
|
+
// be fired if the page is loaded, and the application is created later. Checking for
|
|
33862
|
+
// `readyState` is the easiest way to determine whether the page has been loaded or not.
|
|
33863
|
+
if (doc.readyState === 'complete') {
|
|
33864
|
+
waitToScan();
|
|
33865
|
+
}
|
|
33866
|
+
else {
|
|
33867
|
+
this.window?.addEventListener('load', waitToScan, { once: true });
|
|
33868
|
+
}
|
|
33869
|
+
});
|
|
33870
|
+
}
|
|
33871
|
+
}
|
|
33872
|
+
ngOnDestroy() {
|
|
33873
|
+
this.observer?.disconnect();
|
|
33874
|
+
}
|
|
33875
|
+
initPerformanceObserver() {
|
|
33876
|
+
if (typeof PerformanceObserver === 'undefined') {
|
|
33877
|
+
return null;
|
|
33878
|
+
}
|
|
33879
|
+
const observer = new PerformanceObserver((entryList) => {
|
|
33880
|
+
const entries = entryList.getEntries();
|
|
33881
|
+
if (entries.length === 0)
|
|
33882
|
+
return;
|
|
33883
|
+
// We use the latest entry produced by the `PerformanceObserver` as the best
|
|
33884
|
+
// signal on which element is actually an LCP one. As an example, the first image to load on
|
|
33885
|
+
// a page, by virtue of being the only thing on the page so far, is often a LCP candidate
|
|
33886
|
+
// and gets reported by PerformanceObserver, but isn't necessarily the LCP element.
|
|
33887
|
+
const lcpElement = entries[entries.length - 1];
|
|
33888
|
+
// Cast to `any` due to missing `element` on the `LargestContentfulPaint` type of entry.
|
|
33889
|
+
// See https://developer.mozilla.org/en-US/docs/Web/API/LargestContentfulPaint
|
|
33890
|
+
const imgSrc = lcpElement.element?.src ?? '';
|
|
33891
|
+
// Exclude `data:` and `blob:` URLs, since they are fetched resources.
|
|
33892
|
+
if (imgSrc.startsWith('data:') || imgSrc.startsWith('blob:'))
|
|
33893
|
+
return;
|
|
33894
|
+
this.lcpImageUrl = imgSrc;
|
|
33895
|
+
});
|
|
33896
|
+
observer.observe({ type: 'largest-contentful-paint', buffered: true });
|
|
33897
|
+
return observer;
|
|
33898
|
+
}
|
|
33899
|
+
scanImages() {
|
|
33900
|
+
const images = getDocument().querySelectorAll('img');
|
|
33901
|
+
let lcpElementFound, lcpElementLoadedCorrectly = false;
|
|
33902
|
+
images.forEach(image => {
|
|
33903
|
+
if (!this.options?.disableImageSizeWarning) {
|
|
33904
|
+
for (const image of images) {
|
|
33905
|
+
// Image elements using the NgOptimizedImage directive are excluded,
|
|
33906
|
+
// as that directive has its own version of this check.
|
|
33907
|
+
if (!image.getAttribute('ng-img') && this.isOversized(image)) {
|
|
33908
|
+
logOversizedImageWarning(image.src);
|
|
33909
|
+
}
|
|
33910
|
+
}
|
|
33911
|
+
}
|
|
33912
|
+
if (!this.options?.disableImageLazyLoadWarning && this.lcpImageUrl) {
|
|
33913
|
+
if (image.src === this.lcpImageUrl) {
|
|
33914
|
+
lcpElementFound = true;
|
|
33915
|
+
if (image.loading !== 'lazy' || image.getAttribute('ng-img')) {
|
|
33916
|
+
// This variable is set to true and never goes back to false to account
|
|
33917
|
+
// for the case where multiple images have the same src url, and some
|
|
33918
|
+
// have lazy loading while others don't.
|
|
33919
|
+
// Also ignore NgOptimizedImage because there's a different warning for that.
|
|
33920
|
+
lcpElementLoadedCorrectly = true;
|
|
33921
|
+
}
|
|
33922
|
+
}
|
|
33923
|
+
}
|
|
33924
|
+
});
|
|
33925
|
+
if (lcpElementFound && !lcpElementLoadedCorrectly && this.lcpImageUrl &&
|
|
33926
|
+
!this.options?.disableImageLazyLoadWarning) {
|
|
33927
|
+
logLazyLCPWarning(this.lcpImageUrl);
|
|
33928
|
+
}
|
|
33929
|
+
}
|
|
33930
|
+
isOversized(image) {
|
|
33931
|
+
if (!this.window) {
|
|
33932
|
+
return false;
|
|
33933
|
+
}
|
|
33934
|
+
const computedStyle = this.window.getComputedStyle(image);
|
|
33935
|
+
let renderedWidth = parseFloat(computedStyle.getPropertyValue('width'));
|
|
33936
|
+
let renderedHeight = parseFloat(computedStyle.getPropertyValue('height'));
|
|
33937
|
+
const boxSizing = computedStyle.getPropertyValue('box-sizing');
|
|
33938
|
+
const objectFit = computedStyle.getPropertyValue('object-fit');
|
|
33939
|
+
if (objectFit === `cover`) {
|
|
33940
|
+
// Object fit cover may indicate a use case such as a sprite sheet where
|
|
33941
|
+
// this warning does not apply.
|
|
33942
|
+
return false;
|
|
33943
|
+
}
|
|
33944
|
+
if (boxSizing === 'border-box') {
|
|
33945
|
+
const paddingTop = computedStyle.getPropertyValue('padding-top');
|
|
33946
|
+
const paddingRight = computedStyle.getPropertyValue('padding-right');
|
|
33947
|
+
const paddingBottom = computedStyle.getPropertyValue('padding-bottom');
|
|
33948
|
+
const paddingLeft = computedStyle.getPropertyValue('padding-left');
|
|
33949
|
+
renderedWidth -= parseFloat(paddingRight) + parseFloat(paddingLeft);
|
|
33950
|
+
renderedHeight -= parseFloat(paddingTop) + parseFloat(paddingBottom);
|
|
33951
|
+
}
|
|
33952
|
+
const intrinsicWidth = image.naturalWidth;
|
|
33953
|
+
const intrinsicHeight = image.naturalHeight;
|
|
33954
|
+
const recommendedWidth = this.window.devicePixelRatio * renderedWidth;
|
|
33955
|
+
const recommendedHeight = this.window.devicePixelRatio * renderedHeight;
|
|
33956
|
+
const oversizedWidth = (intrinsicWidth - recommendedWidth) >= OVERSIZED_IMAGE_TOLERANCE;
|
|
33957
|
+
const oversizedHeight = (intrinsicHeight - recommendedHeight) >= OVERSIZED_IMAGE_TOLERANCE;
|
|
33958
|
+
return oversizedWidth || oversizedHeight;
|
|
33959
|
+
}
|
|
33960
|
+
static { this.ɵfac = function ImagePerformanceWarning_Factory(t) { return new (t || ImagePerformanceWarning)(); }; }
|
|
33961
|
+
static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ImagePerformanceWarning, factory: ImagePerformanceWarning.ɵfac, providedIn: 'root' }); }
|
|
33962
|
+
}
|
|
33963
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ImagePerformanceWarning, [{
|
|
33964
|
+
type: Injectable,
|
|
33965
|
+
args: [{ providedIn: 'root' }]
|
|
33966
|
+
}], null, null); })();
|
|
33967
|
+
function logLazyLCPWarning(src) {
|
|
33968
|
+
console.warn(formatRuntimeError(-913 /* RuntimeErrorCode.IMAGE_PERFORMANCE_WARNING */, `An image with src ${src} is the Largest Contentful Paint (LCP) element ` +
|
|
33969
|
+
`but was given a "loading" value of "lazy", which can negatively impact ` +
|
|
33970
|
+
`application loading performance. This warning can be addressed by ` +
|
|
33971
|
+
`changing the loading value of the LCP image to "eager", or by using the ` +
|
|
33972
|
+
`NgOptimizedImage directive's prioritization utilities. For more ` +
|
|
33973
|
+
`information about addressing or disabling this warning, see ` +
|
|
33974
|
+
`https://angular.io/errors/NG0913`));
|
|
33975
|
+
}
|
|
33976
|
+
function logOversizedImageWarning(src) {
|
|
33977
|
+
console.warn(formatRuntimeError(-913 /* RuntimeErrorCode.IMAGE_PERFORMANCE_WARNING */, `An image with src ${src} has intrinsic file dimensions much larger than its ` +
|
|
33978
|
+
`rendered size. This can negatively impact application loading performance. ` +
|
|
33979
|
+
`For more information about addressing or disabling this warning, see ` +
|
|
33980
|
+
`https://angular.io/errors/NG0913`));
|
|
33981
|
+
}
|
|
33982
|
+
|
|
33983
|
+
/**
|
|
33984
|
+
* Internal create application API that implements the core application creation logic and optional
|
|
33985
|
+
* bootstrap logic.
|
|
33986
|
+
*
|
|
33987
|
+
* Platforms (such as `platform-browser`) may require different set of application and platform
|
|
33988
|
+
* providers for an application to function correctly. As a result, platforms may use this function
|
|
33989
|
+
* internally and supply the necessary providers during the bootstrap, while exposing
|
|
33990
|
+
* platform-specific APIs as a part of their public API.
|
|
33991
|
+
*
|
|
33992
|
+
* @returns A promise that returns an `ApplicationRef` instance once resolved.
|
|
33993
|
+
*/
|
|
33994
|
+
function internalCreateApplication(config) {
|
|
33995
|
+
try {
|
|
33996
|
+
const { rootComponent, appProviders, platformProviders } = config;
|
|
33997
|
+
if ((typeof ngDevMode === 'undefined' || ngDevMode) && rootComponent !== undefined) {
|
|
33998
|
+
assertStandaloneComponentType(rootComponent);
|
|
33999
|
+
}
|
|
34000
|
+
const platformInjector = createOrReusePlatformInjector(platformProviders);
|
|
34001
|
+
// Create root application injector based on a set of providers configured at the platform
|
|
34002
|
+
// bootstrap level as well as providers passed to the bootstrap call by a user.
|
|
34003
|
+
const allAppProviders = [
|
|
34004
|
+
provideZoneChangeDetection(),
|
|
34005
|
+
...(appProviders || []),
|
|
34006
|
+
];
|
|
34007
|
+
const adapter = new EnvironmentNgModuleRefAdapter({
|
|
34008
|
+
providers: allAppProviders,
|
|
34009
|
+
parent: platformInjector,
|
|
34010
|
+
debugName: (typeof ngDevMode === 'undefined' || ngDevMode) ? 'Environment Injector' : '',
|
|
34011
|
+
// We skip environment initializers because we need to run them inside the NgZone, which
|
|
34012
|
+
// happens after we get the NgZone instance from the Injector.
|
|
34013
|
+
runEnvironmentInitializers: false,
|
|
34014
|
+
});
|
|
34015
|
+
const envInjector = adapter.injector;
|
|
34016
|
+
const ngZone = envInjector.get(NgZone);
|
|
34017
|
+
return ngZone.run(() => {
|
|
34018
|
+
envInjector.resolveInjectorInitializers();
|
|
34019
|
+
const exceptionHandler = envInjector.get(ErrorHandler, null);
|
|
34020
|
+
if ((typeof ngDevMode === 'undefined' || ngDevMode) && !exceptionHandler) {
|
|
34021
|
+
throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, 'No `ErrorHandler` found in the Dependency Injection tree.');
|
|
34022
|
+
}
|
|
34023
|
+
let onErrorSubscription;
|
|
34024
|
+
ngZone.runOutsideAngular(() => {
|
|
34025
|
+
onErrorSubscription = ngZone.onError.subscribe({
|
|
34026
|
+
next: (error) => {
|
|
34027
|
+
exceptionHandler.handleError(error);
|
|
34028
|
+
}
|
|
34029
|
+
});
|
|
34030
|
+
});
|
|
34031
|
+
// If the whole platform is destroyed, invoke the `destroy` method
|
|
34032
|
+
// for all bootstrapped applications as well.
|
|
34033
|
+
const destroyListener = () => envInjector.destroy();
|
|
34034
|
+
const onPlatformDestroyListeners = platformInjector.get(PLATFORM_DESTROY_LISTENERS);
|
|
34035
|
+
onPlatformDestroyListeners.add(destroyListener);
|
|
34036
|
+
envInjector.onDestroy(() => {
|
|
34037
|
+
onErrorSubscription.unsubscribe();
|
|
34038
|
+
onPlatformDestroyListeners.delete(destroyListener);
|
|
34039
|
+
});
|
|
34040
|
+
return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {
|
|
34041
|
+
const initStatus = envInjector.get(ApplicationInitStatus);
|
|
34042
|
+
initStatus.runInitializers();
|
|
34043
|
+
return initStatus.donePromise.then(() => {
|
|
34044
|
+
const localeId = envInjector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
|
|
34045
|
+
setLocaleId(localeId || DEFAULT_LOCALE_ID);
|
|
34046
|
+
const appRef = envInjector.get(ApplicationRef);
|
|
34047
|
+
if (rootComponent !== undefined) {
|
|
34048
|
+
appRef.bootstrap(rootComponent);
|
|
34049
|
+
}
|
|
34050
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
34051
|
+
const imagePerformanceService = envInjector.get(ImagePerformanceWarning);
|
|
34052
|
+
imagePerformanceService.start();
|
|
34053
|
+
}
|
|
34054
|
+
return appRef;
|
|
34055
|
+
});
|
|
34056
|
+
});
|
|
34057
|
+
});
|
|
34058
|
+
}
|
|
34059
|
+
catch (e) {
|
|
34060
|
+
return Promise.reject(e);
|
|
34061
|
+
}
|
|
34062
|
+
}
|
|
34063
|
+
|
|
33992
34064
|
/**
|
|
33993
34065
|
* Retrieves all defer blocks in a given LView.
|
|
33994
34066
|
*
|
|
@@ -35041,5 +35113,5 @@ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
|
35041
35113
|
* Generated bundle index. Do not edit.
|
|
35042
35114
|
*/
|
|
35043
35115
|
|
|
35044
|
-
export { ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, AfterRenderPhase, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CSP_NONCE, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, DestroyRef, Directive, ENVIRONMENT_INITIALIZER, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgProbeToken, NgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, Renderer2, RendererFactory2, RendererStyleFlags2, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, TransferState, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, afterNextRender, afterRender, asNativeElements, assertInInjectionContext, assertNotInReactiveContext, assertPlatform, booleanAttribute, computed, createComponent, createEnvironmentInjector, createNgModule, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, effect, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, isSignal, isStandalone, makeEnvironmentProviders, makeStateKey, mergeApplicationConfig, numberAttribute, platformCore, provideZoneChangeDetection, reflectComponentType, resolveForwardRef, runInInjectionContext, setTestabilityGetter, signal, untracked, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, AfterRenderEventManager as ɵAfterRenderEventManager, CONTAINER_HEADER_OFFSET as ɵCONTAINER_HEADER_OFFSET, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, DEFER_BLOCK_CONFIG as ɵDEFER_BLOCK_CONFIG, DEFER_BLOCK_DEPENDENCY_INTERCEPTOR as ɵDEFER_BLOCK_DEPENDENCY_INTERCEPTOR, DeferBlockBehavior as ɵDeferBlockBehavior, DeferBlockState as ɵDeferBlockState, EffectScheduler as ɵEffectScheduler, IMAGE_CONFIG as ɵIMAGE_CONFIG, IMAGE_CONFIG_DEFAULTS as ɵIMAGE_CONFIG_DEFAULTS, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, IS_HYDRATION_DOM_REUSE_ENABLED as ɵIS_HYDRATION_DOM_REUSE_ENABLED, InitialRenderPendingTasks as ɵInitialRenderPendingTasks, LContext as ɵLContext, LifecycleHooksFeature as ɵLifecycleHooksFeature, LocaleDataIndex as ɵLocaleDataIndex, NG_COMP_DEF as ɵNG_COMP_DEF, NG_DIR_DEF as ɵNG_DIR_DEF, NG_ELEMENT_ID as ɵNG_ELEMENT_ID, NG_INJ_DEF as ɵNG_INJ_DEF, NG_MOD_DEF as ɵNG_MOD_DEF, NG_PIPE_DEF as ɵNG_PIPE_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE as ɵNO_CHANGE, NgModuleFactory as ɵNgModuleFactory, NoopNgZone as ɵNoopNgZone, ReflectionCapabilities as ɵReflectionCapabilities, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, NgModuleRef as ɵRender3NgModuleRef, RuntimeError as ɵRuntimeError, SSR_CONTENT_INTEGRITY_MARKER as ɵSSR_CONTENT_INTEGRITY_MARKER, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, USE_RUNTIME_DEPS_TRACKER_FOR_JIT as ɵUSE_RUNTIME_DEPS_TRACKER_FOR_JIT, ViewRef$1 as ɵViewRef, XSS_SECURITY_URL as ɵXSS_SECURITY_URL, ZoneAwareQueueingScheduler as ɵZoneAwareQueueingScheduler, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, annotateForHydration as ɵannotateForHydration, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, convertToBitFlags as ɵconvertToBitFlags, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, depsTracker as ɵdepsTracker, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, formatRuntimeError as ɵformatRuntimeError, generateStandaloneInDeclarationsError as ɵgenerateStandaloneInDeclarationsError, getAsyncClassMetadataFn as ɵgetAsyncClassMetadataFn, getDebugNode as ɵgetDebugNode, getDeferBlocks as ɵgetDeferBlocks, getDirectives as ɵgetDirectives, getHostElement as ɵgetHostElement, getInjectableDef as ɵgetInjectableDef, getLContext as ɵgetLContext, getLocaleCurrencyCode as ɵgetLocaleCurrencyCode, getLocalePluralCase as ɵgetLocalePluralCase, getSanitizationBypassType as ɵgetSanitizationBypassType, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, _global as ɵglobal, injectChangeDetectorRef as ɵinjectChangeDetectorRef, internalAfterNextRender as ɵinternalAfterNextRender, internalCreateApplication as ɵinternalCreateApplication, isBoundToModule as ɵisBoundToModule, isComponentDefPendingResolution as ɵisComponentDefPendingResolution, isEnvironmentProviders as ɵisEnvironmentProviders, isInjectable as ɵisInjectable, isNgModule as ɵisNgModule, isPromise as ɵisPromise, isSubscribable as ɵisSubscribable, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, performanceMarkFeature as ɵperformanceMarkFeature, publishDefaultGlobalUtils$1 as ɵpublishDefaultGlobalUtils, publishGlobalUtil as ɵpublishGlobalUtil, registerLocaleData as ɵregisterLocaleData, renderDeferBlockState as ɵrenderDeferBlockState, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, restoreComponentResolutionQueue as ɵrestoreComponentResolutionQueue, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setAlternateWeakRefImpl as ɵsetAlternateWeakRefImpl, ɵsetClassDebugInfo, setClassMetadata as ɵsetClassMetadata, setClassMetadataAsync as ɵsetClassMetadataAsync, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setInjectorProfilerContext as ɵsetInjectorProfilerContext, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, triggerResourceLoading as ɵtriggerResourceLoading, truncateMiddle as ɵtruncateMiddle, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, whenStable as ɵwhenStable, withDomHydration as ɵwithDomHydration, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, ɵɵInputTransformsFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵStandaloneFeature, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcomponentInstance, ɵɵconditional, ɵɵcontentQuery, ɵɵdefer, ɵɵdeferEnableTimerScheduling, ɵɵdeferOnHover, ɵɵdeferOnIdle, ɵɵdeferOnImmediate, ɵɵdeferOnInteraction, ɵɵdeferOnTimer, ɵɵdeferOnViewport, ɵɵdeferPrefetchOnHover, ɵɵdeferPrefetchOnIdle, ɵɵdeferPrefetchOnImmediate, ɵɵdeferPrefetchOnInteraction, ɵɵdeferPrefetchOnTimer, ɵɵdeferPrefetchOnViewport, ɵɵdeferPrefetchWhen, ɵɵdeferWhen, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetComponentDepsFactory, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryRefresh, ɵɵreference, registerNgModuleType as ɵɵregisterNgModuleType, ɵɵrepeater, ɵɵrepeaterCreate, ɵɵrepeaterTrackByIdentity, ɵɵrepeaterTrackByIndex, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵvalidateIframeAttribute, ɵɵviewQuery };
|
|
35116
|
+
export { ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, AfterRenderPhase, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CSP_NONCE, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, DestroyRef, Directive, ENVIRONMENT_INITIALIZER, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgProbeToken, NgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, Renderer2, RendererFactory2, RendererStyleFlags2, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, TransferState, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, afterNextRender, afterRender, asNativeElements, assertInInjectionContext, assertNotInReactiveContext, assertPlatform, booleanAttribute, computed, createComponent, createEnvironmentInjector, createNgModule, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, effect, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, isSignal, isStandalone, makeEnvironmentProviders, makeStateKey, mergeApplicationConfig, numberAttribute, platformCore, provideZoneChangeDetection, reflectComponentType, resolveForwardRef, runInInjectionContext, setTestabilityGetter, signal, untracked, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, AfterRenderEventManager as ɵAfterRenderEventManager, CONTAINER_HEADER_OFFSET as ɵCONTAINER_HEADER_OFFSET, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, DEFER_BLOCK_CONFIG as ɵDEFER_BLOCK_CONFIG, DEFER_BLOCK_DEPENDENCY_INTERCEPTOR as ɵDEFER_BLOCK_DEPENDENCY_INTERCEPTOR, DeferBlockBehavior as ɵDeferBlockBehavior, DeferBlockState as ɵDeferBlockState, EffectScheduler as ɵEffectScheduler, IMAGE_CONFIG as ɵIMAGE_CONFIG, IMAGE_CONFIG_DEFAULTS as ɵIMAGE_CONFIG_DEFAULTS, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, ɵINPUT_SIGNAL_BRAND_WRITE_TYPE, IS_HYDRATION_DOM_REUSE_ENABLED as ɵIS_HYDRATION_DOM_REUSE_ENABLED, InitialRenderPendingTasks as ɵInitialRenderPendingTasks, LContext as ɵLContext, LifecycleHooksFeature as ɵLifecycleHooksFeature, LocaleDataIndex as ɵLocaleDataIndex, NG_COMP_DEF as ɵNG_COMP_DEF, NG_DIR_DEF as ɵNG_DIR_DEF, NG_ELEMENT_ID as ɵNG_ELEMENT_ID, NG_INJ_DEF as ɵNG_INJ_DEF, NG_MOD_DEF as ɵNG_MOD_DEF, NG_PIPE_DEF as ɵNG_PIPE_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE as ɵNO_CHANGE, NgModuleFactory as ɵNgModuleFactory, NoopNgZone as ɵNoopNgZone, ReflectionCapabilities as ɵReflectionCapabilities, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, NgModuleRef as ɵRender3NgModuleRef, RuntimeError as ɵRuntimeError, SSR_CONTENT_INTEGRITY_MARKER as ɵSSR_CONTENT_INTEGRITY_MARKER, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, USE_RUNTIME_DEPS_TRACKER_FOR_JIT as ɵUSE_RUNTIME_DEPS_TRACKER_FOR_JIT, ViewRef$1 as ɵViewRef, XSS_SECURITY_URL as ɵXSS_SECURITY_URL, ZoneAwareQueueingScheduler as ɵZoneAwareQueueingScheduler, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, annotateForHydration as ɵannotateForHydration, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, convertToBitFlags as ɵconvertToBitFlags, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, depsTracker as ɵdepsTracker, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, formatRuntimeError as ɵformatRuntimeError, generateStandaloneInDeclarationsError as ɵgenerateStandaloneInDeclarationsError, getAsyncClassMetadataFn as ɵgetAsyncClassMetadataFn, getDebugNode as ɵgetDebugNode, getDeferBlocks as ɵgetDeferBlocks, getDirectives as ɵgetDirectives, getHostElement as ɵgetHostElement, getInjectableDef as ɵgetInjectableDef, getLContext as ɵgetLContext, getLocaleCurrencyCode as ɵgetLocaleCurrencyCode, getLocalePluralCase as ɵgetLocalePluralCase, getSanitizationBypassType as ɵgetSanitizationBypassType, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, _global as ɵglobal, injectChangeDetectorRef as ɵinjectChangeDetectorRef, input as ɵinput, inputFunction as ɵinputFunctionForApiGuard, inputRequiredFunction as ɵinputFunctionRequiredForApiGuard, internalAfterNextRender as ɵinternalAfterNextRender, internalCreateApplication as ɵinternalCreateApplication, isBoundToModule as ɵisBoundToModule, isComponentDefPendingResolution as ɵisComponentDefPendingResolution, isEnvironmentProviders as ɵisEnvironmentProviders, isInjectable as ɵisInjectable, isNgModule as ɵisNgModule, isPromise as ɵisPromise, isSubscribable as ɵisSubscribable, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, performanceMarkFeature as ɵperformanceMarkFeature, publishDefaultGlobalUtils$1 as ɵpublishDefaultGlobalUtils, publishGlobalUtil as ɵpublishGlobalUtil, registerLocaleData as ɵregisterLocaleData, renderDeferBlockState as ɵrenderDeferBlockState, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, restoreComponentResolutionQueue as ɵrestoreComponentResolutionQueue, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setAlternateWeakRefImpl as ɵsetAlternateWeakRefImpl, ɵsetClassDebugInfo, setClassMetadata as ɵsetClassMetadata, setClassMetadataAsync as ɵsetClassMetadataAsync, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setInjectorProfilerContext as ɵsetInjectorProfilerContext, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, triggerResourceLoading as ɵtriggerResourceLoading, truncateMiddle as ɵtruncateMiddle, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, whenStable as ɵwhenStable, withDomHydration as ɵwithDomHydration, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, ɵɵInputTransformsFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵStandaloneFeature, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcomponentInstance, ɵɵconditional, ɵɵcontentQuery, ɵɵdefer, ɵɵdeferEnableTimerScheduling, ɵɵdeferOnHover, ɵɵdeferOnIdle, ɵɵdeferOnImmediate, ɵɵdeferOnInteraction, ɵɵdeferOnTimer, ɵɵdeferOnViewport, ɵɵdeferPrefetchOnHover, ɵɵdeferPrefetchOnIdle, ɵɵdeferPrefetchOnImmediate, ɵɵdeferPrefetchOnInteraction, ɵɵdeferPrefetchOnTimer, ɵɵdeferPrefetchOnViewport, ɵɵdeferPrefetchWhen, ɵɵdeferWhen, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetComponentDepsFactory, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryRefresh, ɵɵreference, registerNgModuleType as ɵɵregisterNgModuleType, ɵɵrepeater, ɵɵrepeaterCreate, ɵɵrepeaterTrackByIdentity, ɵɵrepeaterTrackByIndex, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵvalidateIframeAttribute, ɵɵviewQuery };
|
|
35045
35117
|
//# sourceMappingURL=core.mjs.map
|