@angular/core 22.0.0-next.9 → 22.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/_attribute-chunk.mjs +1 -1
- package/fesm2022/_debug_node-chunk.mjs +1220 -1199
- package/fesm2022/_debug_node-chunk.mjs.map +1 -1
- package/fesm2022/_effect-chunk.mjs +1 -1
- package/fesm2022/_not_found-chunk.mjs +1 -1
- package/fesm2022/_pending_tasks-chunk.mjs +150 -36
- package/fesm2022/_pending_tasks-chunk.mjs.map +1 -1
- package/fesm2022/_resource-chunk.mjs +56 -18
- package/fesm2022/_resource-chunk.mjs.map +1 -1
- package/fesm2022/_untracked-chunk.mjs +1 -1
- package/fesm2022/_weak_ref-chunk.mjs +1 -1
- package/fesm2022/core.mjs +129 -134
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives-di.mjs +1 -1
- package/fesm2022/primitives-event-dispatch.mjs +1 -1
- package/fesm2022/primitives-signals.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/testing.mjs +47 -3
- package/fesm2022/testing.mjs.map +1 -1
- package/package.json +7 -3
- package/schematics/bundles/apply_import_manager-CxA_YYgB.cjs +1 -1
- package/schematics/bundles/can-match-snapshot-required.cjs +1 -1
- package/schematics/bundles/change-detection-eager.cjs +1 -1
- package/schematics/bundles/cleanup-unused-imports.cjs +1 -1
- package/schematics/bundles/common-to-standalone-migration.cjs +1 -1
- package/schematics/bundles/compiler_host-CY14HvaP.cjs +1 -1
- package/schematics/bundles/control-flow-migration.cjs +1 -1
- package/schematics/bundles/http-xhr-backend.cjs +1 -1
- package/schematics/bundles/imports-CKV-ITqD.cjs +1 -1
- package/schematics/bundles/incremental-hydration.cjs +10 -7
- package/schematics/bundles/{index-DADA7AvC.cjs → index-DxFMpcXS.cjs} +7 -2
- package/schematics/bundles/inject-migration.cjs +1 -1
- package/schematics/bundles/json-file-Drblb4E1.cjs +1 -1
- package/schematics/bundles/leading_space-BTPRV0wu.cjs +1 -1
- package/schematics/bundles/{migrate_ts_type_references-B9LlDDUg.cjs → migrate_ts_type_references-DMv-GSuu.cjs} +28 -10
- package/schematics/bundles/model-output.cjs +200 -0
- package/schematics/bundles/ng_component_template-DPAF1aEA.cjs +1 -1
- package/schematics/bundles/ng_decorators-IVztR9rk.cjs +1 -1
- package/schematics/bundles/ngclass-to-class-migration.cjs +1 -1
- package/schematics/bundles/ngstyle-to-style-migration.cjs +1 -1
- package/schematics/bundles/nodes-ZSQ7WZRB.cjs +1 -1
- package/schematics/bundles/output-migration.cjs +2 -2
- package/schematics/bundles/parse_html-C8eKA9px.cjs +1 -1
- package/schematics/bundles/project_paths-D2V-Uh2L.cjs +1 -1
- package/schematics/bundles/project_tsconfig_paths-DkkMibv-.cjs +1 -1
- package/schematics/bundles/property_name-BCpALNpZ.cjs +1 -1
- package/schematics/bundles/route-lazy-loading.cjs +1 -1
- package/schematics/bundles/router-testing-module-migration.cjs +1 -1
- package/schematics/bundles/safe-optional-chaining.cjs +570 -0
- package/schematics/bundles/self-closing-tags-migration.cjs +1 -1
- package/schematics/bundles/signal-input-migration.cjs +3 -3
- package/schematics/bundles/signal-queries-migration.cjs +3 -3
- package/schematics/bundles/signals.cjs +3 -3
- package/schematics/bundles/standalone-migration.cjs +1 -1
- package/schematics/bundles/strict-safe-navigation-narrow.cjs +1 -1
- package/schematics/bundles/strict-templates-default.cjs +1 -1
- package/schematics/migrations.json +10 -0
- package/third_party/@mcp-b/webmcp-types/LICENSE +21 -0
- package/third_party/@mcp-b/webmcp-types/dist/common.d.ts +297 -0
- package/third_party/@mcp-b/webmcp-types/dist/json-schema.d.ts +196 -0
- package/third_party/@mcp-b/webmcp-types/index.d.ts +9 -0
- package/types/_api-chunk.d.ts +23 -14
- package/types/_chrome_dev_tools_performance-chunk.d.ts +1 -1
- package/types/_debug_node-chunk.d.ts +1 -1
- package/types/_effect-chunk.d.ts +1 -1
- package/types/_event_dispatcher-chunk.d.ts +1 -1
- package/types/_formatter-chunk.d.ts +1 -1
- package/types/_weak_ref-chunk.d.ts +1 -1
- package/types/core.d.ts +5175 -4960
- package/types/primitives-di.d.ts +1 -1
- package/types/primitives-event-dispatch.d.ts +1 -1
- package/types/primitives-signals.d.ts +1 -1
- package/types/rxjs-interop.d.ts +4 -4
- package/types/testing.d.ts +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v22.0.0-
|
|
2
|
+
* @license Angular v22.0.0-rc.0
|
|
3
3
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { assertString, EMPTY_OBJ, assertFirstCreatePass, assertDefined, assertNotEqual, FLAGS, assertEqual, isInCheckNoChangesMode, PREORDER_HOOK_FLAGS, throwError, assertNumber, assertGreaterThan, HEADER_OFFSET, DECLARATION_VIEW, NG_FACTORY_DEF, isForwardRef, resolveForwardRef, getFactoryDef, convertToBitFlags, isRootView, assertTNodeForLView, enterDI, runInInjectorProfilerContext, getCurrentTNode, getLView, emitInjectorToCreateInstanceEvent, emitInstanceCreatedByInjectorEvent, throwProviderNotFoundError, leaveDI, assertNodeInjector, setInjectImplementation, injectRootLimpMode, stringifyForError, cyclicDependencyErrorWithDetails, cyclicDependencyError, setInjectorProfilerContext, assertDirectiveDef, EMBEDDED_VIEW_INJECTOR, T_HOST, NG_ELEMENT_ID, assertIndexInRange, INJECTOR, TVIEW, isComponentDef, isComponentHost, DECLARATION_COMPONENT_VIEW, makeEnvironmentProviders, InjectionToken, _global, ɵɵinvalidFactoryDep as __invalidFactoryDep, ɵɵinject as __inject, ɵɵdefineInjector as __defineInjector, ɵɵdefineInjectable as __defineInjectable, newArray, attachInjectFlag, RuntimeError, NG_PROV_DEF, getClosureSafeProperty, getNativeByTNode, registerSpecialProvider, flatten, arrayEquals, ID, isLView, assertDomNode, EMPTY_ARRAY, getComponentLViewByIndex, CONTEXT, unwrapRNode, assertLView, HOST, getLViewParent, isLContainer, CONTAINER_HEADER_OFFSET, CHILD_HEAD, NEXT, Injector, CLEANUP, getComponentDef, getDirectiveDef, APP_ID, inject, makeStateKey, formatRuntimeError, TransferState, isInSkipHydrationBlock as isInSkipHydrationBlock$1, HYDRATION, isContentQueryHost, setCurrentQueryIndex, isDirectiveHost, XSS_SECURITY_URL, RENDERER, renderStringify, getSelectedTNode, ENVIRONMENT, resetPreOrderHookFlags, PARENT, CHILD_TAIL, assertSame, assertFirstUpdatePass, getSelectedIndex, getTView, assertIndexInDeclRange, setSelectedIndex, stringify, ANIMATIONS, AFTER_RENDER_SEQUENCES_TO_ADD, markAncestorsForTraversal, NgZone, ChangeDetectionScheduler, ErrorHandler, assertNotInReactiveContext, assertInInjectionContext, DestroyRef, ViewContext, EnvironmentInjector, INJECTOR$1, isDestroyed, assertLContainer, MOVED_VIEWS, assertProjectionSlots, NATIVE, REACTIVE_TEMPLATE_CONSUMER, DECLARATION_LCONTAINER, QUERIES, assertParentView, assertNotReactive, ON_DESTROY_HOOKS, assertFunction, EFFECTS, INTERNAL_APPLICATION_ERROR_HANDLER, assertNotSame, isCurrentTNodeParent, setCurrentTNodeAsNotParent, assertHasParent, setCurrentTNode, getElementDepthCount, increaseElementDepthCount, wasLastNodeCreated, setCurrentDirectiveIndex, getCurrentDirectiveIndex, unwrapLView, enterView, leaveView, isCreationMode, markViewForRefresh, setIsInCheckNoChangesMode, setIsRefreshingViews, isExhaustiveCheckNoChanges, requiresRefreshOrTraversal, setBindingIndex, EFFECTS_TO_SCHEDULE, setBindingRootForHostBindings, viewAttachedToChangeDetector, CheckNoChangesMode, isRefreshingViews, removeFromArray, addToArray, updateAncestorTraversalFlagsOnAttach, storeLViewOnDestroy, VIEW_REFS, DOC_PAGE_BASE_URL, assertGreaterThanOrEqual, isInI18nBlock, assertTNodeForTView, getCurrentParentTNode, getCurrentTNodePlaceholderOk, assertTIcu, assertTNode, assertNumberInRange, DEHYDRATED_VIEWS, getNgModuleDef, getPipeDef as getPipeDef$1, getNgModuleDefOrThrow, isStandalone, getTNode, assertLessThan, getOrCreateTViewCleanup, getOrCreateLViewCleanup, debugStringifyTypeForError, assertNotDefined, nextBindingIndex, concatStringsWithSpace, assertInjectImplementationNotEqual, emitInjectEvent, getConstant, getDirectiveDefOrThrow, DOCUMENT as DOCUMENT$1, SVG_NAMESPACE, MATH_ML_NAMESPACE, viewAttachedToContainer, storeCleanupWithContext, signal, createInjectorWithoutInjectorInstances, R3Injector, getNullInjector, internalImportProvidersFrom, initNgDevMode, runInInjectionContext, fillProperties, getBindingsEnabled, lastNodeWasCreated, removeLViewOnDestroy, walkUpViews, getNativeByIndex, assertElement, setInjectorProfiler, EffectRefImpl, NullInjector, getAllSpecialProviders, ENVIRONMENT_INITIALIZER, INJECTOR_DEF_TYPES, walkProviderTree, getInjectorDef, deepForEach, isTypeProvider, VERSION, retrieveTransferredState, isSignal, isInInjectionContext, PendingTasksInternal, ZONELESS_ENABLED, EffectScheduler, arrayInsert2, arraySplice, PendingTasks, decreaseElementDepthCount, assertTNodeCreationIndex, getNamespace, enterSkipHydrationBlock, isSkipHydrationRootTNode, leaveSkipHydrationBlock, getCurrentDirectiveDef, getBindingIndex, assertIndexInExpandoRange, assertOneOf, setInI18nBlock, nextContextImpl, getCurrentQueryIndex, getContextLView, load, keyValueArrayIndexOf, incrementBindingIndex, keyValueArrayGet, keyValueArraySet, isWritableSignal, store, getBindingRoot, providerToFactory, emitProviderConfiguredEvent, isClassProvider, NG_COMP_DEF, forwardRef, ɵɵrestoreView as __restoreView, ɵɵdisableBindings as __disableBindings, ɵɵenableBindings as __enableBindings, ɵɵnamespaceSVG as __namespaceSVG, ɵɵnamespaceMathML as __namespaceMathML, ɵɵnamespaceHTML as __namespaceHTML, ɵɵresetView as __resetView, NG_MOD_DEF, NG_INJ_DEF, NG_DIR_DEF, NG_PIPE_DEF, PROVIDED_ZONELESS, NoopNgZone, angularZoneInstanceIdProperty, scheduleCallbackWithMicrotask, scheduleCallbackWithRafRace, SCHEDULE_IN_ROOT_ZONE, getNativeByTNodeOrNull } from './_pending_tasks-chunk.mjs';
|
|
8
8
|
import { setActiveConsumer as setActiveConsumer$1 } from '@angular/core/primitives/signals';
|
|
9
9
|
import { setActiveConsumer, SIGNAL, consumerDestroy, REACTIVE_NODE, consumerPollProducersForChange, consumerBeforeComputation, getActiveConsumer, consumerAfterComputation, createComputed, setThrowInvalidWriteToSignalError } from './_effect-chunk.mjs';
|
|
10
10
|
import { Subject, Subscription } from 'rxjs';
|
|
@@ -17,1168 +17,1204 @@ function noSideEffects(fn) {
|
|
|
17
17
|
}.toString();
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
function DecoratorFactory(...args) {
|
|
27
|
-
if (this instanceof DecoratorFactory) {
|
|
28
|
-
metaCtor.call(this, ...args);
|
|
29
|
-
return this;
|
|
30
|
-
}
|
|
31
|
-
const annotationInstance = new DecoratorFactory(...args);
|
|
32
|
-
return function TypeDecorator(cls) {
|
|
33
|
-
if (typeFn) typeFn(cls, ...args);
|
|
34
|
-
const annotations = cls.hasOwnProperty(ANNOTATIONS) ? cls[ANNOTATIONS] : Object.defineProperty(cls, ANNOTATIONS, {
|
|
35
|
-
value: []
|
|
36
|
-
})[ANNOTATIONS];
|
|
37
|
-
annotations.push(annotationInstance);
|
|
38
|
-
return cls;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
if (parentClass) {
|
|
42
|
-
DecoratorFactory.prototype = Object.create(parentClass.prototype);
|
|
43
|
-
}
|
|
44
|
-
DecoratorFactory.prototype.ngMetadataName = name;
|
|
45
|
-
DecoratorFactory.annotationCls = DecoratorFactory;
|
|
46
|
-
return DecoratorFactory;
|
|
47
|
-
});
|
|
20
|
+
function applyValueToInputField(instance, inputSignalNode, privateName, value) {
|
|
21
|
+
if (inputSignalNode !== null) {
|
|
22
|
+
inputSignalNode.applyValueToInputSignal(inputSignalNode, value);
|
|
23
|
+
} else {
|
|
24
|
+
instance[privateName] = value;
|
|
25
|
+
}
|
|
48
26
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
27
|
+
|
|
28
|
+
class SimpleChange {
|
|
29
|
+
previousValue;
|
|
30
|
+
currentValue;
|
|
31
|
+
firstChange;
|
|
32
|
+
constructor(previousValue, currentValue, firstChange) {
|
|
33
|
+
this.previousValue = previousValue;
|
|
34
|
+
this.currentValue = currentValue;
|
|
35
|
+
this.firstChange = firstChange;
|
|
36
|
+
}
|
|
37
|
+
isFirstChange() {
|
|
38
|
+
return this.firstChange;
|
|
39
|
+
}
|
|
58
40
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
function ParamDecorator(cls, unusedKey, index) {
|
|
71
|
-
const parameters = cls.hasOwnProperty(PARAMETERS) ? cls[PARAMETERS] : Object.defineProperty(cls, PARAMETERS, {
|
|
72
|
-
value: []
|
|
73
|
-
})[PARAMETERS];
|
|
74
|
-
while (parameters.length <= index) {
|
|
75
|
-
parameters.push(null);
|
|
76
|
-
}
|
|
77
|
-
(parameters[index] = parameters[index] || []).push(annotationInstance);
|
|
78
|
-
return cls;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
ParamDecoratorFactory.prototype.ngMetadataName = name;
|
|
82
|
-
ParamDecoratorFactory.annotationCls = ParamDecoratorFactory;
|
|
83
|
-
return ParamDecoratorFactory;
|
|
84
|
-
});
|
|
41
|
+
|
|
42
|
+
const ɵɵNgOnChangesFeature = /* @__PURE__ */(() => {
|
|
43
|
+
const ɵɵNgOnChangesFeatureImpl = () => NgOnChangesFeatureImpl;
|
|
44
|
+
ɵɵNgOnChangesFeatureImpl.ngInherit = true;
|
|
45
|
+
return ɵɵNgOnChangesFeatureImpl;
|
|
46
|
+
})();
|
|
47
|
+
function NgOnChangesFeatureImpl(definition) {
|
|
48
|
+
if (definition.type.prototype.ngOnChanges) {
|
|
49
|
+
definition.setInput = ngOnChangesSetInput;
|
|
50
|
+
}
|
|
51
|
+
return rememberChangeHistoryAndInvokeOnChangesHook;
|
|
85
52
|
}
|
|
86
|
-
function
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
if (target === undefined) {
|
|
97
|
-
throw new Error('Standard Angular field decorators are not supported in JIT mode.');
|
|
98
|
-
}
|
|
99
|
-
const constructor = target.constructor;
|
|
100
|
-
const meta = constructor.hasOwnProperty(PROP_METADATA) ? constructor[PROP_METADATA] : Object.defineProperty(constructor, PROP_METADATA, {
|
|
101
|
-
value: {}
|
|
102
|
-
})[PROP_METADATA];
|
|
103
|
-
meta[name] = meta.hasOwnProperty(name) && meta[name] || [];
|
|
104
|
-
meta[name].unshift(decoratorInstance);
|
|
53
|
+
function rememberChangeHistoryAndInvokeOnChangesHook() {
|
|
54
|
+
const simpleChangesStore = getSimpleChangesStore(this);
|
|
55
|
+
const current = simpleChangesStore?.current;
|
|
56
|
+
if (current) {
|
|
57
|
+
const previous = simpleChangesStore.previous;
|
|
58
|
+
if (previous === EMPTY_OBJ) {
|
|
59
|
+
simpleChangesStore.previous = current;
|
|
60
|
+
} else {
|
|
61
|
+
for (let key in current) {
|
|
62
|
+
previous[key] = current[key];
|
|
105
63
|
}
|
|
106
|
-
return PropDecorator;
|
|
107
64
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
65
|
+
simpleChangesStore.current = null;
|
|
66
|
+
this.ngOnChanges(current);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function ngOnChangesSetInput(instance, inputSignalNode, value, publicName, privateName) {
|
|
70
|
+
const declaredName = this.declaredInputs[publicName];
|
|
71
|
+
ngDevMode && assertString(declaredName, 'Name of input in ngOnChanges has to be a string');
|
|
72
|
+
const simpleChangesStore = getSimpleChangesStore(instance) || setSimpleChangesStore(instance, {
|
|
73
|
+
previous: EMPTY_OBJ,
|
|
74
|
+
current: null
|
|
114
75
|
});
|
|
76
|
+
const current = simpleChangesStore.current || (simpleChangesStore.current = {});
|
|
77
|
+
const previous = simpleChangesStore.previous;
|
|
78
|
+
const previousChange = previous[declaredName];
|
|
79
|
+
current[declaredName] = new SimpleChange(previousChange && previousChange.currentValue, value, previous === EMPTY_OBJ);
|
|
80
|
+
applyValueToInputField(instance, inputSignalNode, privateName, value);
|
|
81
|
+
}
|
|
82
|
+
const SIMPLE_CHANGES_STORE = '__ngSimpleChanges__';
|
|
83
|
+
function getSimpleChangesStore(instance) {
|
|
84
|
+
return instance[SIMPLE_CHANGES_STORE] || null;
|
|
85
|
+
}
|
|
86
|
+
function setSimpleChangesStore(instance, store) {
|
|
87
|
+
return instance[SIMPLE_CHANGES_STORE] = store;
|
|
115
88
|
}
|
|
116
89
|
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
const Host = attachInjectFlag(makeParamDecorator('Host'), 1);
|
|
124
|
-
|
|
125
|
-
function getCompilerFacade(request) {
|
|
126
|
-
const globalNg = _global['ng'];
|
|
127
|
-
if (globalNg && globalNg.ɵcompilerFacade) {
|
|
128
|
-
return globalNg.ɵcompilerFacade;
|
|
90
|
+
const profilerCallbacks = [];
|
|
91
|
+
const NOOP_PROFILER_REMOVAL = () => {};
|
|
92
|
+
function removeProfiler(profiler) {
|
|
93
|
+
const profilerIdx = profilerCallbacks.indexOf(profiler);
|
|
94
|
+
if (profilerIdx !== -1) {
|
|
95
|
+
profilerCallbacks.splice(profilerIdx, 1);
|
|
129
96
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
if (
|
|
134
|
-
|
|
135
|
-
message += `However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.\n`;
|
|
136
|
-
message += '\n';
|
|
137
|
-
message += `Ideally, the library is processed using the Angular Linker to become fully AOT compiled.\n`;
|
|
138
|
-
} else {
|
|
139
|
-
message += `JIT compilation is discouraged for production use-cases! Consider using AOT mode instead.\n`;
|
|
97
|
+
}
|
|
98
|
+
function setProfiler(profiler) {
|
|
99
|
+
if (profiler !== null) {
|
|
100
|
+
if (!profilerCallbacks.includes(profiler)) {
|
|
101
|
+
profilerCallbacks.push(profiler);
|
|
140
102
|
}
|
|
141
|
-
|
|
142
|
-
message += `or manually provide the compiler with 'import "@angular/compiler";' before bootstrapping.`;
|
|
143
|
-
throw new Error(message);
|
|
103
|
+
return () => removeProfiler(profiler);
|
|
144
104
|
} else {
|
|
145
|
-
|
|
105
|
+
profilerCallbacks.length = 0;
|
|
106
|
+
return NOOP_PROFILER_REMOVAL;
|
|
146
107
|
}
|
|
147
108
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
factory: opts.factory,
|
|
154
|
-
value: undefined
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
const angularCoreDiEnv = {
|
|
159
|
-
'ɵɵdefineInjectable': __defineInjectable,
|
|
160
|
-
'ɵɵdefineInjector': __defineInjector,
|
|
161
|
-
'ɵɵdefineService': ɵɵdefineService,
|
|
162
|
-
'ɵɵinject': __inject,
|
|
163
|
-
'ɵɵinvalidFactoryDep': __invalidFactoryDep,
|
|
164
|
-
'resolveForwardRef': resolveForwardRef
|
|
109
|
+
const profiler = function (event, instance = null, eventFn) {
|
|
110
|
+
for (let i = 0; i < profilerCallbacks.length; i++) {
|
|
111
|
+
const profilerCallback = profilerCallbacks[i];
|
|
112
|
+
profilerCallback(event, instance, eventFn);
|
|
113
|
+
}
|
|
165
114
|
};
|
|
166
115
|
|
|
167
|
-
|
|
168
|
-
function
|
|
169
|
-
|
|
170
|
-
|
|
116
|
+
var ProfilerEvent;
|
|
117
|
+
(function (ProfilerEvent) {
|
|
118
|
+
ProfilerEvent[ProfilerEvent["TemplateCreateStart"] = 0] = "TemplateCreateStart";
|
|
119
|
+
ProfilerEvent[ProfilerEvent["TemplateCreateEnd"] = 1] = "TemplateCreateEnd";
|
|
120
|
+
ProfilerEvent[ProfilerEvent["TemplateUpdateStart"] = 2] = "TemplateUpdateStart";
|
|
121
|
+
ProfilerEvent[ProfilerEvent["TemplateUpdateEnd"] = 3] = "TemplateUpdateEnd";
|
|
122
|
+
ProfilerEvent[ProfilerEvent["LifecycleHookStart"] = 4] = "LifecycleHookStart";
|
|
123
|
+
ProfilerEvent[ProfilerEvent["LifecycleHookEnd"] = 5] = "LifecycleHookEnd";
|
|
124
|
+
ProfilerEvent[ProfilerEvent["OutputStart"] = 6] = "OutputStart";
|
|
125
|
+
ProfilerEvent[ProfilerEvent["OutputEnd"] = 7] = "OutputEnd";
|
|
126
|
+
ProfilerEvent[ProfilerEvent["BootstrapApplicationStart"] = 8] = "BootstrapApplicationStart";
|
|
127
|
+
ProfilerEvent[ProfilerEvent["BootstrapApplicationEnd"] = 9] = "BootstrapApplicationEnd";
|
|
128
|
+
ProfilerEvent[ProfilerEvent["BootstrapComponentStart"] = 10] = "BootstrapComponentStart";
|
|
129
|
+
ProfilerEvent[ProfilerEvent["BootstrapComponentEnd"] = 11] = "BootstrapComponentEnd";
|
|
130
|
+
ProfilerEvent[ProfilerEvent["ChangeDetectionStart"] = 12] = "ChangeDetectionStart";
|
|
131
|
+
ProfilerEvent[ProfilerEvent["ChangeDetectionEnd"] = 13] = "ChangeDetectionEnd";
|
|
132
|
+
ProfilerEvent[ProfilerEvent["ChangeDetectionSyncStart"] = 14] = "ChangeDetectionSyncStart";
|
|
133
|
+
ProfilerEvent[ProfilerEvent["ChangeDetectionSyncEnd"] = 15] = "ChangeDetectionSyncEnd";
|
|
134
|
+
ProfilerEvent[ProfilerEvent["AfterRenderHooksStart"] = 16] = "AfterRenderHooksStart";
|
|
135
|
+
ProfilerEvent[ProfilerEvent["AfterRenderHooksEnd"] = 17] = "AfterRenderHooksEnd";
|
|
136
|
+
ProfilerEvent[ProfilerEvent["ComponentStart"] = 18] = "ComponentStart";
|
|
137
|
+
ProfilerEvent[ProfilerEvent["ComponentEnd"] = 19] = "ComponentEnd";
|
|
138
|
+
ProfilerEvent[ProfilerEvent["DeferBlockStateStart"] = 20] = "DeferBlockStateStart";
|
|
139
|
+
ProfilerEvent[ProfilerEvent["DeferBlockStateEnd"] = 21] = "DeferBlockStateEnd";
|
|
140
|
+
ProfilerEvent[ProfilerEvent["DynamicComponentStart"] = 22] = "DynamicComponentStart";
|
|
141
|
+
ProfilerEvent[ProfilerEvent["DynamicComponentEnd"] = 23] = "DynamicComponentEnd";
|
|
142
|
+
ProfilerEvent[ProfilerEvent["HostBindingsUpdateStart"] = 24] = "HostBindingsUpdateStart";
|
|
143
|
+
ProfilerEvent[ProfilerEvent["HostBindingsUpdateEnd"] = 25] = "HostBindingsUpdateEnd";
|
|
144
|
+
})(ProfilerEvent || (ProfilerEvent = {}));
|
|
171
145
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
factory(t) {
|
|
185
|
-
return (...args) => new t(...args);
|
|
186
|
-
}
|
|
187
|
-
_zipTypesAndAnnotations(paramTypes, paramAnnotations) {
|
|
188
|
-
let result;
|
|
189
|
-
if (typeof paramTypes === 'undefined') {
|
|
190
|
-
result = newArray(paramAnnotations.length);
|
|
191
|
-
} else {
|
|
192
|
-
result = newArray(paramTypes.length);
|
|
193
|
-
}
|
|
194
|
-
for (let i = 0; i < result.length; i++) {
|
|
195
|
-
if (typeof paramTypes === 'undefined') {
|
|
196
|
-
result[i] = [];
|
|
197
|
-
} else if (paramTypes[i] && paramTypes[i] != Object) {
|
|
198
|
-
result[i] = [paramTypes[i]];
|
|
199
|
-
} else {
|
|
200
|
-
result[i] = [];
|
|
201
|
-
}
|
|
202
|
-
if (paramAnnotations && paramAnnotations[i] != null) {
|
|
203
|
-
result[i] = result[i].concat(paramAnnotations[i]);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
return result;
|
|
146
|
+
function registerPreOrderHooks(directiveIndex, directiveDef, tView) {
|
|
147
|
+
ngDevMode && assertFirstCreatePass(tView);
|
|
148
|
+
const {
|
|
149
|
+
ngOnChanges,
|
|
150
|
+
ngOnInit,
|
|
151
|
+
ngDoCheck
|
|
152
|
+
} = directiveDef.type.prototype;
|
|
153
|
+
if (ngOnChanges) {
|
|
154
|
+
const wrappedOnChanges = NgOnChangesFeatureImpl(directiveDef);
|
|
155
|
+
(tView.preOrderHooks ??= []).push(directiveIndex, wrappedOnChanges);
|
|
156
|
+
(tView.preOrderCheckHooks ??= []).push(directiveIndex, wrappedOnChanges);
|
|
207
157
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
if (isDelegateCtor(typeStr)) {
|
|
211
|
-
return null;
|
|
212
|
-
}
|
|
213
|
-
if (type.parameters && type.parameters !== parentCtor.parameters) {
|
|
214
|
-
return type.parameters;
|
|
215
|
-
}
|
|
216
|
-
const tsickleCtorParams = type.ctorParameters;
|
|
217
|
-
if (tsickleCtorParams && tsickleCtorParams !== parentCtor.ctorParameters) {
|
|
218
|
-
const ctorParameters = typeof tsickleCtorParams === 'function' ? tsickleCtorParams() : tsickleCtorParams;
|
|
219
|
-
const paramTypes = ctorParameters.map(ctorParam => ctorParam && ctorParam.type);
|
|
220
|
-
const paramAnnotations = ctorParameters.map(ctorParam => ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators));
|
|
221
|
-
return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);
|
|
222
|
-
}
|
|
223
|
-
const paramAnnotations = type.hasOwnProperty(PARAMETERS) && type[PARAMETERS];
|
|
224
|
-
const paramTypes = this._reflect && this._reflect.getOwnMetadata && this._reflect.getOwnMetadata('design:paramtypes', type);
|
|
225
|
-
if (paramTypes || paramAnnotations) {
|
|
226
|
-
return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);
|
|
227
|
-
}
|
|
228
|
-
return newArray(type.length);
|
|
158
|
+
if (ngOnInit) {
|
|
159
|
+
(tView.preOrderHooks ??= []).push(0 - directiveIndex, ngOnInit);
|
|
229
160
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
234
|
-
const parentCtor = getParentCtor(type);
|
|
235
|
-
let parameters = this._ownParameters(type, parentCtor);
|
|
236
|
-
if (!parameters && parentCtor !== Object) {
|
|
237
|
-
parameters = this.parameters(parentCtor);
|
|
238
|
-
}
|
|
239
|
-
return parameters || [];
|
|
161
|
+
if (ngDoCheck) {
|
|
162
|
+
(tView.preOrderHooks ??= []).push(directiveIndex, ngDoCheck);
|
|
163
|
+
(tView.preOrderCheckHooks ??= []).push(directiveIndex, ngDoCheck);
|
|
240
164
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
165
|
+
}
|
|
166
|
+
function registerPostOrderHooks(tView, tNode) {
|
|
167
|
+
ngDevMode && assertFirstCreatePass(tView);
|
|
168
|
+
for (let i = tNode.directiveStart, end = tNode.directiveEnd; i < end; i++) {
|
|
169
|
+
const directiveDef = tView.data[i];
|
|
170
|
+
ngDevMode && assertDefined(directiveDef, 'Expecting DirectiveDef');
|
|
171
|
+
const lifecycleHooks = directiveDef.type.prototype;
|
|
172
|
+
const {
|
|
173
|
+
ngAfterContentInit,
|
|
174
|
+
ngAfterContentChecked,
|
|
175
|
+
ngAfterViewInit,
|
|
176
|
+
ngAfterViewChecked,
|
|
177
|
+
ngOnDestroy
|
|
178
|
+
} = lifecycleHooks;
|
|
179
|
+
if (ngAfterContentInit) {
|
|
180
|
+
(tView.contentHooks ??= []).push(-i, ngAfterContentInit);
|
|
254
181
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
if (!isType(typeOrFunc)) {
|
|
259
|
-
return [];
|
|
182
|
+
if (ngAfterContentChecked) {
|
|
183
|
+
(tView.contentHooks ??= []).push(i, ngAfterContentChecked);
|
|
184
|
+
(tView.contentCheckHooks ??= []).push(i, ngAfterContentChecked);
|
|
260
185
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
const parentAnnotations = parentCtor !== Object ? this.annotations(parentCtor) : [];
|
|
264
|
-
return parentAnnotations.concat(ownAnnotations);
|
|
265
|
-
}
|
|
266
|
-
_ownPropMetadata(typeOrFunc, parentCtor) {
|
|
267
|
-
if (typeOrFunc.propMetadata && typeOrFunc.propMetadata !== parentCtor.propMetadata) {
|
|
268
|
-
let propMetadata = typeOrFunc.propMetadata;
|
|
269
|
-
if (typeof propMetadata === 'function' && propMetadata.propMetadata) {
|
|
270
|
-
propMetadata = propMetadata.propMetadata;
|
|
271
|
-
}
|
|
272
|
-
return propMetadata;
|
|
186
|
+
if (ngAfterViewInit) {
|
|
187
|
+
(tView.viewHooks ??= []).push(-i, ngAfterViewInit);
|
|
273
188
|
}
|
|
274
|
-
if (
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
Object.keys(propDecorators).forEach(prop => {
|
|
278
|
-
propMetadata[prop] = convertTsickleDecoratorIntoMetadata(propDecorators[prop]);
|
|
279
|
-
});
|
|
280
|
-
return propMetadata;
|
|
189
|
+
if (ngAfterViewChecked) {
|
|
190
|
+
(tView.viewHooks ??= []).push(i, ngAfterViewChecked);
|
|
191
|
+
(tView.viewCheckHooks ??= []).push(i, ngAfterViewChecked);
|
|
281
192
|
}
|
|
282
|
-
if (
|
|
283
|
-
|
|
193
|
+
if (ngOnDestroy != null) {
|
|
194
|
+
(tView.destroyHooks ??= []).push(i, ngOnDestroy);
|
|
284
195
|
}
|
|
285
|
-
return null;
|
|
286
196
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
Object.keys(parentPropMetadata).forEach(propName => {
|
|
296
|
-
propMetadata[propName] = parentPropMetadata[propName];
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
const ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor);
|
|
300
|
-
if (ownPropMetadata) {
|
|
301
|
-
Object.keys(ownPropMetadata).forEach(propName => {
|
|
302
|
-
const decorators = [];
|
|
303
|
-
if (propMetadata.hasOwnProperty(propName)) {
|
|
304
|
-
decorators.push(...propMetadata[propName]);
|
|
305
|
-
}
|
|
306
|
-
decorators.push(...ownPropMetadata[propName]);
|
|
307
|
-
propMetadata[propName] = decorators;
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
return propMetadata;
|
|
197
|
+
}
|
|
198
|
+
function executeCheckHooks(lView, hooks, nodeIndex) {
|
|
199
|
+
callHooks(lView, hooks, 3, nodeIndex);
|
|
200
|
+
}
|
|
201
|
+
function executeInitAndCheckHooks(lView, hooks, initPhase, nodeIndex) {
|
|
202
|
+
ngDevMode && assertNotEqual(initPhase, 3, 'Init pre-order hooks should not be called more than once');
|
|
203
|
+
if ((lView[FLAGS] & 3) === initPhase) {
|
|
204
|
+
callHooks(lView, hooks, initPhase, nodeIndex);
|
|
311
205
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
206
|
+
}
|
|
207
|
+
function incrementInitPhaseFlags(lView, initPhase) {
|
|
208
|
+
ngDevMode && assertNotEqual(initPhase, 3, 'Init hooks phase should not be incremented after all init hooks have been run.');
|
|
209
|
+
let flags = lView[FLAGS];
|
|
210
|
+
if ((flags & 3) === initPhase) {
|
|
211
|
+
flags &= 16383;
|
|
212
|
+
flags += 1;
|
|
213
|
+
lView[FLAGS] = flags;
|
|
317
214
|
}
|
|
318
|
-
|
|
319
|
-
|
|
215
|
+
}
|
|
216
|
+
function callHooks(currentView, arr, initPhase, currentNodeIndex) {
|
|
217
|
+
ngDevMode && assertEqual(isInCheckNoChangesMode(), false, 'Hooks should never be run when in check no changes mode.');
|
|
218
|
+
const startIndex = currentNodeIndex !== undefined ? currentView[PREORDER_HOOK_FLAGS] & 65535 : 0;
|
|
219
|
+
const nodeIndexLimit = currentNodeIndex != null ? currentNodeIndex : -1;
|
|
220
|
+
const max = arr.length - 1;
|
|
221
|
+
let lastNodeIndexFound = 0;
|
|
222
|
+
for (let i = startIndex; i < max; i++) {
|
|
223
|
+
const hook = arr[i + 1];
|
|
224
|
+
if (typeof hook === 'number') {
|
|
225
|
+
lastNodeIndexFound = arr[i];
|
|
226
|
+
if (currentNodeIndex != null && lastNodeIndexFound >= currentNodeIndex) {
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
} else {
|
|
230
|
+
const isInitHook = arr[i] < 0;
|
|
231
|
+
if (isInitHook) {
|
|
232
|
+
currentView[PREORDER_HOOK_FLAGS] += 65536;
|
|
233
|
+
}
|
|
234
|
+
if (lastNodeIndexFound < nodeIndexLimit || nodeIndexLimit == -1) {
|
|
235
|
+
callHook(currentView, initPhase, arr, i);
|
|
236
|
+
currentView[PREORDER_HOOK_FLAGS] = (currentView[PREORDER_HOOK_FLAGS] & 4294901760) + i + 2;
|
|
237
|
+
}
|
|
238
|
+
i++;
|
|
239
|
+
}
|
|
320
240
|
}
|
|
321
241
|
}
|
|
322
|
-
function
|
|
323
|
-
|
|
324
|
-
|
|
242
|
+
function callHookInternal(directive, hook) {
|
|
243
|
+
profiler(ProfilerEvent.LifecycleHookStart, directive, hook);
|
|
244
|
+
const prevConsumer = setActiveConsumer(null);
|
|
245
|
+
try {
|
|
246
|
+
hook.call(directive);
|
|
247
|
+
} finally {
|
|
248
|
+
setActiveConsumer(prevConsumer);
|
|
249
|
+
profiler(ProfilerEvent.LifecycleHookEnd, directive, hook);
|
|
325
250
|
}
|
|
326
|
-
return decoratorInvocations.map(decoratorInvocation => {
|
|
327
|
-
const decoratorType = decoratorInvocation.type;
|
|
328
|
-
const annotationCls = decoratorType.annotationCls;
|
|
329
|
-
const annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];
|
|
330
|
-
return new annotationCls(...annotationArgs);
|
|
331
|
-
});
|
|
332
251
|
}
|
|
333
|
-
function
|
|
334
|
-
const
|
|
335
|
-
const
|
|
336
|
-
|
|
252
|
+
function callHook(currentView, initPhase, arr, i) {
|
|
253
|
+
const isInitHook = arr[i] < 0;
|
|
254
|
+
const hook = arr[i + 1];
|
|
255
|
+
const directiveIndex = isInitHook ? -arr[i] : arr[i];
|
|
256
|
+
const directive = currentView[directiveIndex];
|
|
257
|
+
if (isInitHook) {
|
|
258
|
+
const indexWithintInitPhase = currentView[FLAGS] >> 14;
|
|
259
|
+
if (indexWithintInitPhase < currentView[PREORDER_HOOK_FLAGS] >> 16 && (currentView[FLAGS] & 3) === initPhase) {
|
|
260
|
+
currentView[FLAGS] += 16384;
|
|
261
|
+
callHookInternal(directive, hook);
|
|
262
|
+
}
|
|
263
|
+
} else {
|
|
264
|
+
callHookInternal(directive, hook);
|
|
265
|
+
}
|
|
337
266
|
}
|
|
338
267
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
268
|
+
const NO_PARENT_INJECTOR = -1;
|
|
269
|
+
class NodeInjectorFactory {
|
|
270
|
+
factory;
|
|
271
|
+
name;
|
|
272
|
+
injectImpl;
|
|
273
|
+
resolving = false;
|
|
274
|
+
canSeeViewProviders;
|
|
275
|
+
multi;
|
|
276
|
+
componentProviders;
|
|
277
|
+
index;
|
|
278
|
+
providerFactory;
|
|
279
|
+
constructor(factory, isViewProvider, injectImplementation, name) {
|
|
280
|
+
this.factory = factory;
|
|
281
|
+
this.name = name;
|
|
282
|
+
ngDevMode && assertDefined(factory, 'Factory not specified');
|
|
283
|
+
ngDevMode && assertEqual(typeof factory, 'function', 'Expected factory function.');
|
|
284
|
+
this.canSeeViewProviders = isViewProvider;
|
|
285
|
+
this.injectImpl = injectImplementation;
|
|
344
286
|
}
|
|
345
287
|
}
|
|
346
288
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
289
|
+
function toTNodeTypeAsString(tNodeType) {
|
|
290
|
+
let text = '';
|
|
291
|
+
tNodeType & 1 && (text += '|Text');
|
|
292
|
+
tNodeType & 2 && (text += '|Element');
|
|
293
|
+
tNodeType & 4 && (text += '|Container');
|
|
294
|
+
tNodeType & 8 && (text += '|ElementContainer');
|
|
295
|
+
tNodeType & 16 && (text += '|Projection');
|
|
296
|
+
tNodeType & 32 && (text += '|IcuContainer');
|
|
297
|
+
tNodeType & 64 && (text += '|Placeholder');
|
|
298
|
+
tNodeType & 128 && (text += '|LetDeclaration');
|
|
299
|
+
return text.length > 0 ? text.substring(1) : text;
|
|
300
|
+
}
|
|
301
|
+
function isTNodeShape(value) {
|
|
302
|
+
return value != null && typeof value === 'object' && (value.insertBeforeIndex === null || typeof value.insertBeforeIndex === 'number' || Array.isArray(value.insertBeforeIndex));
|
|
303
|
+
}
|
|
304
|
+
function isLetDeclaration(tNode) {
|
|
305
|
+
return !!(tNode.type & 128);
|
|
306
|
+
}
|
|
307
|
+
function hasClassInput(tNode) {
|
|
308
|
+
return (tNode.flags & 8) !== 0;
|
|
309
|
+
}
|
|
310
|
+
function hasStyleInput(tNode) {
|
|
311
|
+
return (tNode.flags & 16) !== 0;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
function assertTNodeType(tNode, expectedTypes, message) {
|
|
315
|
+
assertDefined(tNode, 'should be called with a TNode');
|
|
316
|
+
if ((tNode.type & expectedTypes) === 0) {
|
|
317
|
+
throwError(message || `Expected [${toTNodeTypeAsString(expectedTypes)}] but got ${toTNodeTypeAsString(tNode.type)}.`);
|
|
355
318
|
}
|
|
356
|
-
|
|
357
|
-
|
|
319
|
+
}
|
|
320
|
+
function assertPureTNodeType(type) {
|
|
321
|
+
if (!(type === 2 || type === 1 || type === 4 || type === 8 || type === 32 || type === 16 || type === 64 || type === 128)) {
|
|
322
|
+
throwError(`Expected TNodeType to have only a single type selected, but got ${toTNodeTypeAsString(type)}.`);
|
|
358
323
|
}
|
|
359
324
|
}
|
|
360
325
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
326
|
+
function setUpAttributes(renderer, native, attrs) {
|
|
327
|
+
let i = 0;
|
|
328
|
+
while (i < attrs.length) {
|
|
329
|
+
const value = attrs[i];
|
|
330
|
+
if (typeof value === 'number') {
|
|
331
|
+
if (value !== 0) {
|
|
332
|
+
break;
|
|
333
|
+
}
|
|
334
|
+
i++;
|
|
335
|
+
const namespaceURI = attrs[i++];
|
|
336
|
+
const attrName = attrs[i++];
|
|
337
|
+
const attrVal = attrs[i++];
|
|
338
|
+
renderer.setAttribute(native, attrName, attrVal, namespaceURI);
|
|
339
|
+
} else {
|
|
340
|
+
const attrName = value;
|
|
341
|
+
const attrVal = attrs[++i];
|
|
342
|
+
if (isAnimationProp(attrName)) {
|
|
343
|
+
renderer.setProperty(native, attrName, attrVal);
|
|
344
|
+
} else {
|
|
345
|
+
renderer.setAttribute(native, attrName, attrVal);
|
|
346
|
+
}
|
|
347
|
+
i++;
|
|
348
|
+
}
|
|
369
349
|
}
|
|
370
|
-
return
|
|
350
|
+
return i;
|
|
371
351
|
}
|
|
372
|
-
function
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
352
|
+
function isNameOnlyAttributeMarker(marker) {
|
|
353
|
+
return marker === 3 || marker === 4 || marker === 6;
|
|
354
|
+
}
|
|
355
|
+
function isAnimationProp(name) {
|
|
356
|
+
return name.charCodeAt(0) === 64;
|
|
357
|
+
}
|
|
358
|
+
function mergeHostAttrs(dst, src) {
|
|
359
|
+
if (src === null || src.length === 0) ; else if (dst === null || dst.length === 0) {
|
|
360
|
+
dst = src.slice();
|
|
361
|
+
} else {
|
|
362
|
+
let srcMarker = -1;
|
|
363
|
+
for (let i = 0; i < src.length; i++) {
|
|
364
|
+
const item = src[i];
|
|
365
|
+
if (typeof item === 'number') {
|
|
366
|
+
srcMarker = item;
|
|
367
|
+
} else {
|
|
368
|
+
if (srcMarker === 0) ; else if (srcMarker === -1 || srcMarker === 2) {
|
|
369
|
+
mergeHostAttribute(dst, srcMarker, item, null, src[++i]);
|
|
370
|
+
} else {
|
|
371
|
+
mergeHostAttribute(dst, srcMarker, item, null, null);
|
|
372
|
+
}
|
|
382
373
|
}
|
|
383
374
|
}
|
|
384
|
-
|
|
385
|
-
|
|
375
|
+
}
|
|
376
|
+
return dst;
|
|
377
|
+
}
|
|
378
|
+
function mergeHostAttribute(dst, marker, key1, key2, value) {
|
|
379
|
+
let i = 0;
|
|
380
|
+
let markerInsertPosition = dst.length;
|
|
381
|
+
if (marker === -1) {
|
|
382
|
+
markerInsertPosition = -1;
|
|
383
|
+
} else {
|
|
384
|
+
while (i < dst.length) {
|
|
385
|
+
const dstValue = dst[i++];
|
|
386
|
+
if (typeof dstValue === 'number') {
|
|
387
|
+
if (dstValue === marker) {
|
|
388
|
+
markerInsertPosition = -1;
|
|
389
|
+
break;
|
|
390
|
+
} else if (dstValue > marker) {
|
|
391
|
+
markerInsertPosition = i - 1;
|
|
392
|
+
break;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
while (i < dst.length) {
|
|
398
|
+
const item = dst[i];
|
|
399
|
+
if (typeof item === 'number') {
|
|
400
|
+
break;
|
|
401
|
+
} else if (item === key1) {
|
|
402
|
+
{
|
|
403
|
+
if (value !== null) {
|
|
404
|
+
dst[i + 1] = value;
|
|
405
|
+
}
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
i++;
|
|
410
|
+
if (value !== null) i++;
|
|
411
|
+
}
|
|
412
|
+
if (markerInsertPosition !== -1) {
|
|
413
|
+
dst.splice(markerInsertPosition, 0, marker);
|
|
414
|
+
i = markerInsertPosition + 1;
|
|
415
|
+
}
|
|
416
|
+
dst.splice(i++, 0, key1);
|
|
417
|
+
if (value !== null) {
|
|
418
|
+
dst.splice(i++, 0, value);
|
|
386
419
|
}
|
|
387
420
|
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
const simpleChangesStore = getSimpleChangesStore(instance) || setSimpleChangesStore(instance, {
|
|
392
|
-
previous: EMPTY_OBJ,
|
|
393
|
-
current: null
|
|
394
|
-
});
|
|
395
|
-
const current = simpleChangesStore.current || (simpleChangesStore.current = {});
|
|
396
|
-
const previous = simpleChangesStore.previous;
|
|
397
|
-
const previousChange = previous[declaredName];
|
|
398
|
-
current[declaredName] = new SimpleChange(previousChange && previousChange.currentValue, value, previous === EMPTY_OBJ);
|
|
399
|
-
applyValueToInputField(instance, inputSignalNode, privateName, value);
|
|
421
|
+
|
|
422
|
+
function hasParentInjector(parentLocation) {
|
|
423
|
+
return parentLocation !== NO_PARENT_INJECTOR;
|
|
400
424
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
425
|
+
function getParentInjectorIndex(parentLocation) {
|
|
426
|
+
if (ngDevMode) {
|
|
427
|
+
assertNumber(parentLocation, 'Number expected');
|
|
428
|
+
assertNotEqual(parentLocation, -1, 'Not a valid state.');
|
|
429
|
+
const parentInjectorIndex = parentLocation & 32767;
|
|
430
|
+
assertGreaterThan(parentInjectorIndex, HEADER_OFFSET, 'Parent injector must be pointing past HEADER_OFFSET.');
|
|
431
|
+
}
|
|
432
|
+
return parentLocation & 32767;
|
|
404
433
|
}
|
|
405
|
-
function
|
|
406
|
-
return
|
|
434
|
+
function getParentInjectorViewOffset(parentLocation) {
|
|
435
|
+
return parentLocation >> 16;
|
|
407
436
|
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
profilerCallbacks.splice(profilerIdx, 1);
|
|
437
|
+
function getParentInjectorView(location, startView) {
|
|
438
|
+
let viewOffset = getParentInjectorViewOffset(location);
|
|
439
|
+
let parentView = startView;
|
|
440
|
+
while (viewOffset > 0) {
|
|
441
|
+
parentView = parentView[DECLARATION_VIEW];
|
|
442
|
+
viewOffset--;
|
|
415
443
|
}
|
|
444
|
+
return parentView;
|
|
416
445
|
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
446
|
+
|
|
447
|
+
let includeViewProviders = true;
|
|
448
|
+
function setIncludeViewProviders(v) {
|
|
449
|
+
const oldValue = includeViewProviders;
|
|
450
|
+
includeViewProviders = v;
|
|
451
|
+
return oldValue;
|
|
452
|
+
}
|
|
453
|
+
const BLOOM_SIZE = 256;
|
|
454
|
+
const BLOOM_MASK = BLOOM_SIZE - 1;
|
|
455
|
+
const BLOOM_BUCKET_BITS = 5;
|
|
456
|
+
let nextNgElementId = 0;
|
|
457
|
+
const NOT_FOUND = {};
|
|
458
|
+
function bloomAdd(injectorIndex, tView, type) {
|
|
459
|
+
ngDevMode && assertEqual(tView.firstCreatePass, true, 'expected firstCreatePass to be true');
|
|
460
|
+
let id;
|
|
461
|
+
if (typeof type === 'string') {
|
|
462
|
+
id = type.charCodeAt(0) || 0;
|
|
463
|
+
} else if (type.hasOwnProperty(NG_ELEMENT_ID)) {
|
|
464
|
+
id = type[NG_ELEMENT_ID];
|
|
426
465
|
}
|
|
466
|
+
if (id == null) {
|
|
467
|
+
id = type[NG_ELEMENT_ID] = nextNgElementId++;
|
|
468
|
+
}
|
|
469
|
+
const bloomHash = id & BLOOM_MASK;
|
|
470
|
+
const mask = 1 << bloomHash;
|
|
471
|
+
tView.data[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)] |= mask;
|
|
427
472
|
}
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
473
|
+
function getOrCreateNodeInjectorForNode(tNode, lView) {
|
|
474
|
+
const existingInjectorIndex = getInjectorIndex(tNode, lView);
|
|
475
|
+
if (existingInjectorIndex !== -1) {
|
|
476
|
+
return existingInjectorIndex;
|
|
432
477
|
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
(
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
ProfilerEvent[ProfilerEvent["TemplateUpdateStart"] = 2] = "TemplateUpdateStart";
|
|
440
|
-
ProfilerEvent[ProfilerEvent["TemplateUpdateEnd"] = 3] = "TemplateUpdateEnd";
|
|
441
|
-
ProfilerEvent[ProfilerEvent["LifecycleHookStart"] = 4] = "LifecycleHookStart";
|
|
442
|
-
ProfilerEvent[ProfilerEvent["LifecycleHookEnd"] = 5] = "LifecycleHookEnd";
|
|
443
|
-
ProfilerEvent[ProfilerEvent["OutputStart"] = 6] = "OutputStart";
|
|
444
|
-
ProfilerEvent[ProfilerEvent["OutputEnd"] = 7] = "OutputEnd";
|
|
445
|
-
ProfilerEvent[ProfilerEvent["BootstrapApplicationStart"] = 8] = "BootstrapApplicationStart";
|
|
446
|
-
ProfilerEvent[ProfilerEvent["BootstrapApplicationEnd"] = 9] = "BootstrapApplicationEnd";
|
|
447
|
-
ProfilerEvent[ProfilerEvent["BootstrapComponentStart"] = 10] = "BootstrapComponentStart";
|
|
448
|
-
ProfilerEvent[ProfilerEvent["BootstrapComponentEnd"] = 11] = "BootstrapComponentEnd";
|
|
449
|
-
ProfilerEvent[ProfilerEvent["ChangeDetectionStart"] = 12] = "ChangeDetectionStart";
|
|
450
|
-
ProfilerEvent[ProfilerEvent["ChangeDetectionEnd"] = 13] = "ChangeDetectionEnd";
|
|
451
|
-
ProfilerEvent[ProfilerEvent["ChangeDetectionSyncStart"] = 14] = "ChangeDetectionSyncStart";
|
|
452
|
-
ProfilerEvent[ProfilerEvent["ChangeDetectionSyncEnd"] = 15] = "ChangeDetectionSyncEnd";
|
|
453
|
-
ProfilerEvent[ProfilerEvent["AfterRenderHooksStart"] = 16] = "AfterRenderHooksStart";
|
|
454
|
-
ProfilerEvent[ProfilerEvent["AfterRenderHooksEnd"] = 17] = "AfterRenderHooksEnd";
|
|
455
|
-
ProfilerEvent[ProfilerEvent["ComponentStart"] = 18] = "ComponentStart";
|
|
456
|
-
ProfilerEvent[ProfilerEvent["ComponentEnd"] = 19] = "ComponentEnd";
|
|
457
|
-
ProfilerEvent[ProfilerEvent["DeferBlockStateStart"] = 20] = "DeferBlockStateStart";
|
|
458
|
-
ProfilerEvent[ProfilerEvent["DeferBlockStateEnd"] = 21] = "DeferBlockStateEnd";
|
|
459
|
-
ProfilerEvent[ProfilerEvent["DynamicComponentStart"] = 22] = "DynamicComponentStart";
|
|
460
|
-
ProfilerEvent[ProfilerEvent["DynamicComponentEnd"] = 23] = "DynamicComponentEnd";
|
|
461
|
-
ProfilerEvent[ProfilerEvent["HostBindingsUpdateStart"] = 24] = "HostBindingsUpdateStart";
|
|
462
|
-
ProfilerEvent[ProfilerEvent["HostBindingsUpdateEnd"] = 25] = "HostBindingsUpdateEnd";
|
|
463
|
-
})(ProfilerEvent || (ProfilerEvent = {}));
|
|
464
|
-
|
|
465
|
-
function registerPreOrderHooks(directiveIndex, directiveDef, tView) {
|
|
466
|
-
ngDevMode && assertFirstCreatePass(tView);
|
|
467
|
-
const {
|
|
468
|
-
ngOnChanges,
|
|
469
|
-
ngOnInit,
|
|
470
|
-
ngDoCheck
|
|
471
|
-
} = directiveDef.type.prototype;
|
|
472
|
-
if (ngOnChanges) {
|
|
473
|
-
const wrappedOnChanges = NgOnChangesFeatureImpl(directiveDef);
|
|
474
|
-
(tView.preOrderHooks ??= []).push(directiveIndex, wrappedOnChanges);
|
|
475
|
-
(tView.preOrderCheckHooks ??= []).push(directiveIndex, wrappedOnChanges);
|
|
478
|
+
const tView = lView[TVIEW];
|
|
479
|
+
if (tView.firstCreatePass) {
|
|
480
|
+
tNode.injectorIndex = lView.length;
|
|
481
|
+
insertBloom(tView.data, tNode);
|
|
482
|
+
insertBloom(lView, null);
|
|
483
|
+
insertBloom(tView.blueprint, null);
|
|
476
484
|
}
|
|
477
|
-
|
|
478
|
-
|
|
485
|
+
const parentLoc = getParentInjectorLocation(tNode, lView);
|
|
486
|
+
const injectorIndex = tNode.injectorIndex;
|
|
487
|
+
if (hasParentInjector(parentLoc)) {
|
|
488
|
+
const parentIndex = getParentInjectorIndex(parentLoc);
|
|
489
|
+
const parentLView = getParentInjectorView(parentLoc, lView);
|
|
490
|
+
const parentData = parentLView[TVIEW].data;
|
|
491
|
+
for (let i = 0; i < 8; i++) {
|
|
492
|
+
lView[injectorIndex + i] = parentLView[parentIndex + i] | parentData[parentIndex + i];
|
|
493
|
+
}
|
|
479
494
|
}
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
495
|
+
lView[injectorIndex + 8] = parentLoc;
|
|
496
|
+
return injectorIndex;
|
|
497
|
+
}
|
|
498
|
+
function insertBloom(arr, footer) {
|
|
499
|
+
arr.push(0, 0, 0, 0, 0, 0, 0, 0, footer);
|
|
500
|
+
}
|
|
501
|
+
function getInjectorIndex(tNode, lView) {
|
|
502
|
+
if (tNode.injectorIndex === -1 || tNode.parent && tNode.parent.injectorIndex === tNode.injectorIndex || lView[tNode.injectorIndex + 8] === null) {
|
|
503
|
+
return -1;
|
|
504
|
+
} else {
|
|
505
|
+
ngDevMode && assertIndexInRange(lView, tNode.injectorIndex);
|
|
506
|
+
return tNode.injectorIndex;
|
|
483
507
|
}
|
|
484
508
|
}
|
|
485
|
-
function
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
ngOnDestroy
|
|
497
|
-
} = lifecycleHooks;
|
|
498
|
-
if (ngAfterContentInit) {
|
|
499
|
-
(tView.contentHooks ??= []).push(-i, ngAfterContentInit);
|
|
500
|
-
}
|
|
501
|
-
if (ngAfterContentChecked) {
|
|
502
|
-
(tView.contentHooks ??= []).push(i, ngAfterContentChecked);
|
|
503
|
-
(tView.contentCheckHooks ??= []).push(i, ngAfterContentChecked);
|
|
504
|
-
}
|
|
505
|
-
if (ngAfterViewInit) {
|
|
506
|
-
(tView.viewHooks ??= []).push(-i, ngAfterViewInit);
|
|
507
|
-
}
|
|
508
|
-
if (ngAfterViewChecked) {
|
|
509
|
-
(tView.viewHooks ??= []).push(i, ngAfterViewChecked);
|
|
510
|
-
(tView.viewCheckHooks ??= []).push(i, ngAfterViewChecked);
|
|
509
|
+
function getParentInjectorLocation(tNode, lView) {
|
|
510
|
+
if (tNode.parent && tNode.parent.injectorIndex !== -1) {
|
|
511
|
+
return tNode.parent.injectorIndex;
|
|
512
|
+
}
|
|
513
|
+
let declarationViewOffset = 0;
|
|
514
|
+
let parentTNode = null;
|
|
515
|
+
let lViewCursor = lView;
|
|
516
|
+
while (lViewCursor !== null) {
|
|
517
|
+
parentTNode = getTNodeFromLView(lViewCursor);
|
|
518
|
+
if (parentTNode === null) {
|
|
519
|
+
return NO_PARENT_INJECTOR;
|
|
511
520
|
}
|
|
512
|
-
|
|
513
|
-
|
|
521
|
+
ngDevMode && parentTNode && assertTNodeForLView(parentTNode, lViewCursor[DECLARATION_VIEW]);
|
|
522
|
+
declarationViewOffset++;
|
|
523
|
+
lViewCursor = lViewCursor[DECLARATION_VIEW];
|
|
524
|
+
if (parentTNode.injectorIndex !== -1) {
|
|
525
|
+
return parentTNode.injectorIndex | declarationViewOffset << 16;
|
|
514
526
|
}
|
|
515
527
|
}
|
|
528
|
+
return NO_PARENT_INJECTOR;
|
|
516
529
|
}
|
|
517
|
-
function
|
|
518
|
-
|
|
530
|
+
function diPublicInInjector(injectorIndex, tView, token) {
|
|
531
|
+
bloomAdd(injectorIndex, tView, token);
|
|
519
532
|
}
|
|
520
|
-
function
|
|
521
|
-
ngDevMode &&
|
|
522
|
-
|
|
523
|
-
|
|
533
|
+
function injectAttributeImpl(tNode, attrNameToInject) {
|
|
534
|
+
ngDevMode && assertTNodeType(tNode, 12 | 3);
|
|
535
|
+
ngDevMode && assertDefined(tNode, 'expecting tNode');
|
|
536
|
+
if (attrNameToInject === 'class') {
|
|
537
|
+
return tNode.classes;
|
|
524
538
|
}
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
ngDevMode && assertNotEqual(initPhase, 3, 'Init hooks phase should not be incremented after all init hooks have been run.');
|
|
528
|
-
let flags = lView[FLAGS];
|
|
529
|
-
if ((flags & 3) === initPhase) {
|
|
530
|
-
flags &= 16383;
|
|
531
|
-
flags += 1;
|
|
532
|
-
lView[FLAGS] = flags;
|
|
539
|
+
if (attrNameToInject === 'style') {
|
|
540
|
+
return tNode.styles;
|
|
533
541
|
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
}
|
|
553
|
-
if (lastNodeIndexFound < nodeIndexLimit || nodeIndexLimit == -1) {
|
|
554
|
-
callHook(currentView, initPhase, arr, i);
|
|
555
|
-
currentView[PREORDER_HOOK_FLAGS] = (currentView[PREORDER_HOOK_FLAGS] & 4294901760) + i + 2;
|
|
542
|
+
const attrs = tNode.attrs;
|
|
543
|
+
if (attrs) {
|
|
544
|
+
const attrsLength = attrs.length;
|
|
545
|
+
let i = 0;
|
|
546
|
+
while (i < attrsLength) {
|
|
547
|
+
const value = attrs[i];
|
|
548
|
+
if (isNameOnlyAttributeMarker(value)) break;
|
|
549
|
+
if (value === 0) {
|
|
550
|
+
i = i + 2;
|
|
551
|
+
} else if (typeof value === 'number') {
|
|
552
|
+
i++;
|
|
553
|
+
while (i < attrsLength && typeof attrs[i] === 'string') {
|
|
554
|
+
i++;
|
|
555
|
+
}
|
|
556
|
+
} else if (value === attrNameToInject) {
|
|
557
|
+
return attrs[i + 1];
|
|
558
|
+
} else {
|
|
559
|
+
i = i + 2;
|
|
556
560
|
}
|
|
557
|
-
i++;
|
|
558
561
|
}
|
|
559
562
|
}
|
|
563
|
+
return null;
|
|
560
564
|
}
|
|
561
|
-
function
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
try {
|
|
565
|
-
hook.call(directive);
|
|
566
|
-
} finally {
|
|
567
|
-
setActiveConsumer(prevConsumer);
|
|
568
|
-
profiler(ProfilerEvent.LifecycleHookEnd, directive, hook);
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
function callHook(currentView, initPhase, arr, i) {
|
|
572
|
-
const isInitHook = arr[i] < 0;
|
|
573
|
-
const hook = arr[i + 1];
|
|
574
|
-
const directiveIndex = isInitHook ? -arr[i] : arr[i];
|
|
575
|
-
const directive = currentView[directiveIndex];
|
|
576
|
-
if (isInitHook) {
|
|
577
|
-
const indexWithintInitPhase = currentView[FLAGS] >> 14;
|
|
578
|
-
if (indexWithintInitPhase < currentView[PREORDER_HOOK_FLAGS] >> 16 && (currentView[FLAGS] & 3) === initPhase) {
|
|
579
|
-
currentView[FLAGS] += 16384;
|
|
580
|
-
callHookInternal(directive, hook);
|
|
581
|
-
}
|
|
565
|
+
function notFoundValueOrThrow(notFoundValue, token, flags) {
|
|
566
|
+
if (flags & 8 || notFoundValue !== undefined) {
|
|
567
|
+
return notFoundValue;
|
|
582
568
|
} else {
|
|
583
|
-
|
|
569
|
+
throwProviderNotFoundError(token, 'NodeInjector');
|
|
584
570
|
}
|
|
585
571
|
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
factory;
|
|
590
|
-
name;
|
|
591
|
-
injectImpl;
|
|
592
|
-
resolving = false;
|
|
593
|
-
canSeeViewProviders;
|
|
594
|
-
multi;
|
|
595
|
-
componentProviders;
|
|
596
|
-
index;
|
|
597
|
-
providerFactory;
|
|
598
|
-
constructor(factory, isViewProvider, injectImplementation, name) {
|
|
599
|
-
this.factory = factory;
|
|
600
|
-
this.name = name;
|
|
601
|
-
ngDevMode && assertDefined(factory, 'Factory not specified');
|
|
602
|
-
ngDevMode && assertEqual(typeof factory, 'function', 'Expected factory function.');
|
|
603
|
-
this.canSeeViewProviders = isViewProvider;
|
|
604
|
-
this.injectImpl = injectImplementation;
|
|
572
|
+
function lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue) {
|
|
573
|
+
if (flags & 8 && notFoundValue === undefined) {
|
|
574
|
+
notFoundValue = null;
|
|
605
575
|
}
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
return text.length > 0 ? text.substring(1) : text;
|
|
619
|
-
}
|
|
620
|
-
function isTNodeShape(value) {
|
|
621
|
-
return value != null && typeof value === 'object' && (value.insertBeforeIndex === null || typeof value.insertBeforeIndex === 'number' || Array.isArray(value.insertBeforeIndex));
|
|
622
|
-
}
|
|
623
|
-
function isLetDeclaration(tNode) {
|
|
624
|
-
return !!(tNode.type & 128);
|
|
625
|
-
}
|
|
626
|
-
function hasClassInput(tNode) {
|
|
627
|
-
return (tNode.flags & 8) !== 0;
|
|
628
|
-
}
|
|
629
|
-
function hasStyleInput(tNode) {
|
|
630
|
-
return (tNode.flags & 16) !== 0;
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
function assertTNodeType(tNode, expectedTypes, message) {
|
|
634
|
-
assertDefined(tNode, 'should be called with a TNode');
|
|
635
|
-
if ((tNode.type & expectedTypes) === 0) {
|
|
636
|
-
throwError(message || `Expected [${toTNodeTypeAsString(expectedTypes)}] but got ${toTNodeTypeAsString(tNode.type)}.`);
|
|
576
|
+
if ((flags & (2 | 1)) === 0) {
|
|
577
|
+
const moduleInjector = lView[INJECTOR];
|
|
578
|
+
const previousInjectImplementation = setInjectImplementation(undefined);
|
|
579
|
+
try {
|
|
580
|
+
if (moduleInjector) {
|
|
581
|
+
return moduleInjector.get(token, notFoundValue, flags & 8);
|
|
582
|
+
} else {
|
|
583
|
+
return injectRootLimpMode(token, notFoundValue, flags & 8);
|
|
584
|
+
}
|
|
585
|
+
} finally {
|
|
586
|
+
setInjectImplementation(previousInjectImplementation);
|
|
587
|
+
}
|
|
637
588
|
}
|
|
589
|
+
return notFoundValueOrThrow(notFoundValue, token, flags);
|
|
638
590
|
}
|
|
639
|
-
function
|
|
640
|
-
if (
|
|
641
|
-
|
|
591
|
+
function getOrCreateInjectable(tNode, lView, token, flags = 0, notFoundValue) {
|
|
592
|
+
if (tNode !== null) {
|
|
593
|
+
if (lView[FLAGS] & 2048 && !(flags & 2)) {
|
|
594
|
+
const embeddedInjectorValue = lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, NOT_FOUND);
|
|
595
|
+
if (embeddedInjectorValue !== NOT_FOUND) {
|
|
596
|
+
return embeddedInjectorValue;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
const value = lookupTokenUsingNodeInjector(tNode, lView, token, flags, NOT_FOUND);
|
|
600
|
+
if (value !== NOT_FOUND) {
|
|
601
|
+
return value;
|
|
602
|
+
}
|
|
642
603
|
}
|
|
604
|
+
return lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);
|
|
643
605
|
}
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
606
|
+
function lookupTokenUsingNodeInjector(tNode, lView, token, flags, notFoundValue) {
|
|
607
|
+
const bloomHash = bloomHashBitOrFactory(token);
|
|
608
|
+
if (typeof bloomHash === 'function') {
|
|
609
|
+
if (!enterDI(lView, tNode, flags)) {
|
|
610
|
+
return flags & 1 ? notFoundValueOrThrow(notFoundValue, token, flags) : lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);
|
|
611
|
+
}
|
|
612
|
+
try {
|
|
613
|
+
let value;
|
|
614
|
+
if (ngDevMode) {
|
|
615
|
+
runInInjectorProfilerContext(new NodeInjector(getCurrentTNode(), getLView()), token, () => {
|
|
616
|
+
emitInjectorToCreateInstanceEvent(token);
|
|
617
|
+
value = bloomHash(flags);
|
|
618
|
+
emitInstanceCreatedByInjectorEvent(value);
|
|
619
|
+
});
|
|
620
|
+
} else {
|
|
621
|
+
value = bloomHash(flags);
|
|
652
622
|
}
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
const attrName = attrs[i++];
|
|
656
|
-
const attrVal = attrs[i++];
|
|
657
|
-
renderer.setAttribute(native, attrName, attrVal, namespaceURI);
|
|
658
|
-
} else {
|
|
659
|
-
const attrName = value;
|
|
660
|
-
const attrVal = attrs[++i];
|
|
661
|
-
if (isAnimationProp(attrName)) {
|
|
662
|
-
renderer.setProperty(native, attrName, attrVal);
|
|
623
|
+
if (value == null && !(flags & 8)) {
|
|
624
|
+
throwProviderNotFoundError(token);
|
|
663
625
|
} else {
|
|
664
|
-
|
|
626
|
+
return value;
|
|
627
|
+
}
|
|
628
|
+
} finally {
|
|
629
|
+
leaveDI();
|
|
630
|
+
}
|
|
631
|
+
} else if (typeof bloomHash === 'number') {
|
|
632
|
+
let previousTView = null;
|
|
633
|
+
let injectorIndex = getInjectorIndex(tNode, lView);
|
|
634
|
+
let parentLocation = NO_PARENT_INJECTOR;
|
|
635
|
+
let hostTElementNode = flags & 1 ? lView[DECLARATION_COMPONENT_VIEW][T_HOST] : null;
|
|
636
|
+
if (injectorIndex === -1 || flags & 4) {
|
|
637
|
+
parentLocation = injectorIndex === -1 ? getParentInjectorLocation(tNode, lView) : lView[injectorIndex + 8];
|
|
638
|
+
if (parentLocation === NO_PARENT_INJECTOR || !shouldSearchParent(flags, false)) {
|
|
639
|
+
injectorIndex = -1;
|
|
640
|
+
} else {
|
|
641
|
+
previousTView = lView[TVIEW];
|
|
642
|
+
injectorIndex = getParentInjectorIndex(parentLocation);
|
|
643
|
+
lView = getParentInjectorView(parentLocation, lView);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
while (injectorIndex !== -1) {
|
|
647
|
+
ngDevMode && assertNodeInjector(lView, injectorIndex);
|
|
648
|
+
const tView = lView[TVIEW];
|
|
649
|
+
ngDevMode && assertTNodeForLView(tView.data[injectorIndex + 8], lView);
|
|
650
|
+
if (bloomHasToken(bloomHash, injectorIndex, tView.data)) {
|
|
651
|
+
const instance = searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode);
|
|
652
|
+
if (instance !== NOT_FOUND) {
|
|
653
|
+
return instance;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
parentLocation = lView[injectorIndex + 8];
|
|
657
|
+
if (parentLocation !== NO_PARENT_INJECTOR && shouldSearchParent(flags, lView[TVIEW].data[injectorIndex + 8] === hostTElementNode) && bloomHasToken(bloomHash, injectorIndex, lView)) {
|
|
658
|
+
previousTView = tView;
|
|
659
|
+
injectorIndex = getParentInjectorIndex(parentLocation);
|
|
660
|
+
lView = getParentInjectorView(parentLocation, lView);
|
|
661
|
+
} else {
|
|
662
|
+
injectorIndex = -1;
|
|
665
663
|
}
|
|
666
|
-
i++;
|
|
667
664
|
}
|
|
668
665
|
}
|
|
669
|
-
return
|
|
666
|
+
return notFoundValue;
|
|
670
667
|
}
|
|
671
|
-
function
|
|
672
|
-
|
|
668
|
+
function searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode) {
|
|
669
|
+
const currentTView = lView[TVIEW];
|
|
670
|
+
const tNode = currentTView.data[injectorIndex + 8];
|
|
671
|
+
const canAccessViewProviders = previousTView == null ? isComponentHost(tNode) && includeViewProviders : previousTView != currentTView && (tNode.type & 3) !== 0;
|
|
672
|
+
const isHostSpecialCase = flags & 1 && hostTElementNode === tNode;
|
|
673
|
+
const injectableIdx = locateDirectiveOrProvider(tNode, currentTView, token, canAccessViewProviders, isHostSpecialCase);
|
|
674
|
+
if (injectableIdx !== null) {
|
|
675
|
+
return getNodeInjectable(lView, currentTView, injectableIdx, tNode, flags);
|
|
676
|
+
} else {
|
|
677
|
+
return NOT_FOUND;
|
|
678
|
+
}
|
|
673
679
|
}
|
|
674
|
-
function
|
|
675
|
-
|
|
680
|
+
function locateDirectiveOrProvider(tNode, tView, token, canAccessViewProviders, isHostSpecialCase) {
|
|
681
|
+
const nodeProviderIndexes = tNode.providerIndexes;
|
|
682
|
+
const tInjectables = tView.data;
|
|
683
|
+
const injectablesStart = nodeProviderIndexes & 1048575;
|
|
684
|
+
const directivesStart = tNode.directiveStart;
|
|
685
|
+
const directiveEnd = tNode.directiveEnd;
|
|
686
|
+
const cptViewProvidersCount = nodeProviderIndexes >> 20;
|
|
687
|
+
const startingIndex = canAccessViewProviders ? injectablesStart : injectablesStart + cptViewProvidersCount;
|
|
688
|
+
const endIndex = isHostSpecialCase ? injectablesStart + cptViewProvidersCount : directiveEnd;
|
|
689
|
+
for (let i = startingIndex; i < endIndex; i++) {
|
|
690
|
+
const providerTokenOrDef = tInjectables[i];
|
|
691
|
+
if (i < directivesStart && token === providerTokenOrDef || i >= directivesStart && providerTokenOrDef.type === token) {
|
|
692
|
+
return i;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
if (isHostSpecialCase) {
|
|
696
|
+
const dirDef = tInjectables[directivesStart];
|
|
697
|
+
if (dirDef && isComponentDef(dirDef) && dirDef.type === token) {
|
|
698
|
+
return directivesStart;
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
return null;
|
|
676
702
|
}
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
703
|
+
let injectionPath = [];
|
|
704
|
+
function getNodeInjectable(lView, tView, index, tNode, flags) {
|
|
705
|
+
let value = lView[index];
|
|
706
|
+
const tData = tView.data;
|
|
707
|
+
if (value instanceof NodeInjectorFactory) {
|
|
708
|
+
const factory = value;
|
|
709
|
+
ngDevMode && injectionPath.push(factory.name ?? 'unknown');
|
|
710
|
+
if (factory.resolving) {
|
|
711
|
+
let token = '';
|
|
712
|
+
if (ngDevMode) {
|
|
713
|
+
token = stringifyForError(tData[index]);
|
|
714
|
+
throw cyclicDependencyErrorWithDetails(token, injectionPath);
|
|
686
715
|
} else {
|
|
687
|
-
|
|
688
|
-
mergeHostAttribute(dst, srcMarker, item, null, src[++i]);
|
|
689
|
-
} else {
|
|
690
|
-
mergeHostAttribute(dst, srcMarker, item, null, null);
|
|
691
|
-
}
|
|
716
|
+
throw cyclicDependencyError(token);
|
|
692
717
|
}
|
|
693
718
|
}
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
const dstValue = dst[i++];
|
|
705
|
-
if (typeof dstValue === 'number') {
|
|
706
|
-
if (dstValue === marker) {
|
|
707
|
-
markerInsertPosition = -1;
|
|
708
|
-
break;
|
|
709
|
-
} else if (dstValue > marker) {
|
|
710
|
-
markerInsertPosition = i - 1;
|
|
711
|
-
break;
|
|
712
|
-
}
|
|
713
|
-
}
|
|
719
|
+
const previousIncludeViewProviders = setIncludeViewProviders(factory.canSeeViewProviders);
|
|
720
|
+
factory.resolving = true;
|
|
721
|
+
const token = tData[index].type || tData[index];
|
|
722
|
+
let prevInjectContext;
|
|
723
|
+
if (ngDevMode) {
|
|
724
|
+
const injector = new NodeInjector(tNode, lView);
|
|
725
|
+
prevInjectContext = setInjectorProfilerContext({
|
|
726
|
+
injector,
|
|
727
|
+
token
|
|
728
|
+
});
|
|
714
729
|
}
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
return;
|
|
730
|
+
const previousInjectImplementation = factory.injectImpl ? setInjectImplementation(factory.injectImpl) : null;
|
|
731
|
+
const success = enterDI(lView, tNode, 0);
|
|
732
|
+
ngDevMode && assertEqual(success, true, "Because flags do not contain `SkipSelf' we expect this to always succeed.");
|
|
733
|
+
try {
|
|
734
|
+
ngDevMode && emitInjectorToCreateInstanceEvent(token);
|
|
735
|
+
value = lView[index] = factory.factory(undefined, flags, tData, lView, tNode);
|
|
736
|
+
ngDevMode && emitInstanceCreatedByInjectorEvent(value);
|
|
737
|
+
if (tView.firstCreatePass && index >= tNode.directiveStart) {
|
|
738
|
+
ngDevMode && assertDirectiveDef(tData[index]);
|
|
739
|
+
registerPreOrderHooks(index, tData[index], tView);
|
|
726
740
|
}
|
|
741
|
+
} finally {
|
|
742
|
+
ngDevMode && setInjectorProfilerContext(prevInjectContext);
|
|
743
|
+
previousInjectImplementation !== null && setInjectImplementation(previousInjectImplementation);
|
|
744
|
+
setIncludeViewProviders(previousIncludeViewProviders);
|
|
745
|
+
factory.resolving = false;
|
|
746
|
+
leaveDI();
|
|
747
|
+
ngDevMode && (injectionPath = []);
|
|
727
748
|
}
|
|
728
|
-
i++;
|
|
729
|
-
if (value !== null) i++;
|
|
730
749
|
}
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
750
|
+
return value;
|
|
751
|
+
}
|
|
752
|
+
function bloomHashBitOrFactory(token) {
|
|
753
|
+
ngDevMode && assertDefined(token, 'token must be defined');
|
|
754
|
+
if (typeof token === 'string') {
|
|
755
|
+
return token.charCodeAt(0) || 0;
|
|
734
756
|
}
|
|
735
|
-
|
|
736
|
-
if (
|
|
737
|
-
|
|
757
|
+
const tokenId = token.hasOwnProperty(NG_ELEMENT_ID) ? token[NG_ELEMENT_ID] : undefined;
|
|
758
|
+
if (typeof tokenId === 'number') {
|
|
759
|
+
if (tokenId >= 0) {
|
|
760
|
+
return tokenId & BLOOM_MASK;
|
|
761
|
+
} else {
|
|
762
|
+
ngDevMode && assertEqual(tokenId, -1, 'Expecting to get Special Injector Id');
|
|
763
|
+
return createNodeInjector;
|
|
764
|
+
}
|
|
765
|
+
} else {
|
|
766
|
+
return tokenId;
|
|
738
767
|
}
|
|
739
768
|
}
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
function getParentInjectorIndex(parentLocation) {
|
|
745
|
-
if (ngDevMode) {
|
|
746
|
-
assertNumber(parentLocation, 'Number expected');
|
|
747
|
-
assertNotEqual(parentLocation, -1, 'Not a valid state.');
|
|
748
|
-
const parentInjectorIndex = parentLocation & 32767;
|
|
749
|
-
assertGreaterThan(parentInjectorIndex, HEADER_OFFSET, 'Parent injector must be pointing past HEADER_OFFSET.');
|
|
750
|
-
}
|
|
751
|
-
return parentLocation & 32767;
|
|
769
|
+
function bloomHasToken(bloomHash, injectorIndex, injectorView) {
|
|
770
|
+
const mask = 1 << bloomHash;
|
|
771
|
+
const value = injectorView[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)];
|
|
772
|
+
return !!(value & mask);
|
|
752
773
|
}
|
|
753
|
-
function
|
|
754
|
-
return
|
|
774
|
+
function shouldSearchParent(flags, isFirstHostTNode) {
|
|
775
|
+
return !(flags & 2) && !(flags & 1 && isFirstHostTNode);
|
|
755
776
|
}
|
|
756
|
-
function
|
|
757
|
-
|
|
758
|
-
let parentView = startView;
|
|
759
|
-
while (viewOffset > 0) {
|
|
760
|
-
parentView = parentView[DECLARATION_VIEW];
|
|
761
|
-
viewOffset--;
|
|
762
|
-
}
|
|
763
|
-
return parentView;
|
|
777
|
+
function getNodeInjectorLView(nodeInjector) {
|
|
778
|
+
return nodeInjector._lView;
|
|
764
779
|
}
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
function setIncludeViewProviders(v) {
|
|
768
|
-
const oldValue = includeViewProviders;
|
|
769
|
-
includeViewProviders = v;
|
|
770
|
-
return oldValue;
|
|
780
|
+
function getNodeInjectorTNode(nodeInjector) {
|
|
781
|
+
return nodeInjector._tNode;
|
|
771
782
|
}
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
ngDevMode && assertEqual(tView.firstCreatePass, true, 'expected firstCreatePass to be true');
|
|
779
|
-
let id;
|
|
780
|
-
if (typeof type === 'string') {
|
|
781
|
-
id = type.charCodeAt(0) || 0;
|
|
782
|
-
} else if (type.hasOwnProperty(NG_ELEMENT_ID)) {
|
|
783
|
-
id = type[NG_ELEMENT_ID];
|
|
783
|
+
class NodeInjector {
|
|
784
|
+
_tNode;
|
|
785
|
+
_lView;
|
|
786
|
+
constructor(_tNode, _lView) {
|
|
787
|
+
this._tNode = _tNode;
|
|
788
|
+
this._lView = _lView;
|
|
784
789
|
}
|
|
785
|
-
|
|
786
|
-
|
|
790
|
+
get(token, notFoundValue, flags) {
|
|
791
|
+
return getOrCreateInjectable(this._tNode, this._lView, token, convertToBitFlags(flags), notFoundValue);
|
|
787
792
|
}
|
|
788
|
-
const bloomHash = id & BLOOM_MASK;
|
|
789
|
-
const mask = 1 << bloomHash;
|
|
790
|
-
tView.data[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)] |= mask;
|
|
791
793
|
}
|
|
792
|
-
function
|
|
793
|
-
|
|
794
|
-
if (existingInjectorIndex !== -1) {
|
|
795
|
-
return existingInjectorIndex;
|
|
796
|
-
}
|
|
797
|
-
const tView = lView[TVIEW];
|
|
798
|
-
if (tView.firstCreatePass) {
|
|
799
|
-
tNode.injectorIndex = lView.length;
|
|
800
|
-
insertBloom(tView.data, tNode);
|
|
801
|
-
insertBloom(lView, null);
|
|
802
|
-
insertBloom(tView.blueprint, null);
|
|
803
|
-
}
|
|
804
|
-
const parentLoc = getParentInjectorLocation(tNode, lView);
|
|
805
|
-
const injectorIndex = tNode.injectorIndex;
|
|
806
|
-
if (hasParentInjector(parentLoc)) {
|
|
807
|
-
const parentIndex = getParentInjectorIndex(parentLoc);
|
|
808
|
-
const parentLView = getParentInjectorView(parentLoc, lView);
|
|
809
|
-
const parentData = parentLView[TVIEW].data;
|
|
810
|
-
for (let i = 0; i < 8; i++) {
|
|
811
|
-
lView[injectorIndex + i] = parentLView[parentIndex + i] | parentData[parentIndex + i];
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
lView[injectorIndex + 8] = parentLoc;
|
|
815
|
-
return injectorIndex;
|
|
794
|
+
function createNodeInjector() {
|
|
795
|
+
return new NodeInjector(getCurrentTNode(), getLView());
|
|
816
796
|
}
|
|
817
|
-
function
|
|
818
|
-
|
|
797
|
+
function ɵɵgetInheritedFactory(type) {
|
|
798
|
+
return noSideEffects(() => {
|
|
799
|
+
const ownConstructor = type.prototype.constructor;
|
|
800
|
+
const ownFactory = ownConstructor[NG_FACTORY_DEF] || getFactoryOf(ownConstructor);
|
|
801
|
+
const objectPrototype = Object.prototype;
|
|
802
|
+
let parent = Object.getPrototypeOf(type.prototype).constructor;
|
|
803
|
+
while (parent && parent !== objectPrototype) {
|
|
804
|
+
const factory = parent[NG_FACTORY_DEF] || getFactoryOf(parent);
|
|
805
|
+
if (factory && factory !== ownFactory) {
|
|
806
|
+
return factory;
|
|
807
|
+
}
|
|
808
|
+
parent = Object.getPrototypeOf(parent);
|
|
809
|
+
}
|
|
810
|
+
return t => new t();
|
|
811
|
+
});
|
|
819
812
|
}
|
|
820
|
-
function
|
|
821
|
-
if (
|
|
822
|
-
return
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
813
|
+
function getFactoryOf(type) {
|
|
814
|
+
if (isForwardRef(type)) {
|
|
815
|
+
return () => {
|
|
816
|
+
const factory = getFactoryOf(resolveForwardRef(type));
|
|
817
|
+
return factory && factory();
|
|
818
|
+
};
|
|
826
819
|
}
|
|
820
|
+
return getFactoryDef(type);
|
|
827
821
|
}
|
|
828
|
-
function
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
parentTNode = getTNodeFromLView(lViewCursor);
|
|
837
|
-
if (parentTNode === null) {
|
|
838
|
-
return NO_PARENT_INJECTOR;
|
|
822
|
+
function lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, notFoundValue) {
|
|
823
|
+
let currentTNode = tNode;
|
|
824
|
+
let currentLView = lView;
|
|
825
|
+
while (currentTNode !== null && currentLView !== null && currentLView[FLAGS] & 2048 && !isRootView(currentLView)) {
|
|
826
|
+
ngDevMode && assertTNodeForLView(currentTNode, currentLView);
|
|
827
|
+
const nodeInjectorValue = lookupTokenUsingNodeInjector(currentTNode, currentLView, token, flags | 2, NOT_FOUND);
|
|
828
|
+
if (nodeInjectorValue !== NOT_FOUND) {
|
|
829
|
+
return nodeInjectorValue;
|
|
839
830
|
}
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
831
|
+
let parentTNode = currentTNode.parent;
|
|
832
|
+
if (!parentTNode) {
|
|
833
|
+
const embeddedViewInjector = currentLView[EMBEDDED_VIEW_INJECTOR];
|
|
834
|
+
if (embeddedViewInjector) {
|
|
835
|
+
const embeddedViewInjectorValue = embeddedViewInjector.get(token, NOT_FOUND, flags & -5);
|
|
836
|
+
if (embeddedViewInjectorValue !== NOT_FOUND) {
|
|
837
|
+
return embeddedViewInjectorValue;
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
parentTNode = getTNodeFromLView(currentLView);
|
|
841
|
+
currentLView = currentLView[DECLARATION_VIEW];
|
|
845
842
|
}
|
|
843
|
+
currentTNode = parentTNode;
|
|
844
|
+
}
|
|
845
|
+
return notFoundValue;
|
|
846
|
+
}
|
|
847
|
+
function getTNodeFromLView(lView) {
|
|
848
|
+
const tView = lView[TVIEW];
|
|
849
|
+
const tViewType = tView.type;
|
|
850
|
+
if (tViewType === 2) {
|
|
851
|
+
ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');
|
|
852
|
+
return tView.declTNode;
|
|
853
|
+
} else if (tViewType === 1) {
|
|
854
|
+
return lView[T_HOST];
|
|
846
855
|
}
|
|
847
|
-
return
|
|
856
|
+
return null;
|
|
848
857
|
}
|
|
849
|
-
|
|
850
|
-
|
|
858
|
+
|
|
859
|
+
function ɵɵinjectAttribute(attrNameToInject) {
|
|
860
|
+
return injectAttributeImpl(getCurrentTNode(), attrNameToInject);
|
|
851
861
|
}
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
862
|
+
|
|
863
|
+
const _requestIdleCallback = () => (typeof requestIdleCallback !== 'undefined' ? requestIdleCallback : cb => setTimeout(cb)).bind(globalThis);
|
|
864
|
+
const _cancelIdleCallback = () => (typeof requestIdleCallback !== 'undefined' ? cancelIdleCallback : clearTimeout).bind(globalThis);
|
|
865
|
+
const IDLE_SERVICE = new InjectionToken(ngDevMode ? 'IDLE_SERVICE' : '', {
|
|
866
|
+
factory: () => new RequestIdleCallbackService()
|
|
867
|
+
});
|
|
868
|
+
function provideIdleServiceWith(useExisting) {
|
|
869
|
+
return makeEnvironmentProviders([{
|
|
870
|
+
provide: IDLE_SERVICE,
|
|
871
|
+
useExisting
|
|
872
|
+
}]);
|
|
873
|
+
}
|
|
874
|
+
class RequestIdleCallbackService {
|
|
875
|
+
requestIdleCallback = _requestIdleCallback();
|
|
876
|
+
cancelIdleCallback = _cancelIdleCallback();
|
|
877
|
+
requestOnIdle(callback, options) {
|
|
878
|
+
return this.requestIdleCallback(callback, options);
|
|
857
879
|
}
|
|
858
|
-
|
|
859
|
-
return
|
|
880
|
+
cancelOnIdle(id) {
|
|
881
|
+
return this.cancelIdleCallback(id);
|
|
860
882
|
}
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
function promiseWithResolvers() {
|
|
886
|
+
let resolve;
|
|
887
|
+
let reject;
|
|
888
|
+
const promise = new Promise((res, rej) => {
|
|
889
|
+
resolve = res;
|
|
890
|
+
reject = rej;
|
|
891
|
+
});
|
|
892
|
+
return {
|
|
893
|
+
promise,
|
|
894
|
+
resolve,
|
|
895
|
+
reject
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
const ANNOTATIONS = '__annotations__';
|
|
900
|
+
const PARAMETERS = '__parameters__';
|
|
901
|
+
const PROP_METADATA = '__prop__metadata__';
|
|
902
|
+
function makeDecorator(name, props, parentClass, additionalProcessing, typeFn) {
|
|
903
|
+
return noSideEffects(() => {
|
|
904
|
+
const metaCtor = makeMetadataCtor(props);
|
|
905
|
+
function DecoratorFactory(...args) {
|
|
906
|
+
if (this instanceof DecoratorFactory) {
|
|
907
|
+
metaCtor.call(this, ...args);
|
|
908
|
+
return this;
|
|
879
909
|
}
|
|
910
|
+
const annotationInstance = new DecoratorFactory(...args);
|
|
911
|
+
return function TypeDecorator(cls) {
|
|
912
|
+
if (typeFn) typeFn(cls, ...args);
|
|
913
|
+
const annotations = cls.hasOwnProperty(ANNOTATIONS) ? cls[ANNOTATIONS] : Object.defineProperty(cls, ANNOTATIONS, {
|
|
914
|
+
value: []
|
|
915
|
+
})[ANNOTATIONS];
|
|
916
|
+
annotations.push(annotationInstance);
|
|
917
|
+
return cls;
|
|
918
|
+
};
|
|
880
919
|
}
|
|
881
|
-
|
|
882
|
-
|
|
920
|
+
if (parentClass) {
|
|
921
|
+
DecoratorFactory.prototype = Object.create(parentClass.prototype);
|
|
922
|
+
}
|
|
923
|
+
DecoratorFactory.prototype.ngMetadataName = name;
|
|
924
|
+
DecoratorFactory.annotationCls = DecoratorFactory;
|
|
925
|
+
return DecoratorFactory;
|
|
926
|
+
});
|
|
883
927
|
}
|
|
884
|
-
function
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
928
|
+
function makeMetadataCtor(props) {
|
|
929
|
+
return function ctor(...args) {
|
|
930
|
+
if (props) {
|
|
931
|
+
const values = props(...args);
|
|
932
|
+
for (const propName in values) {
|
|
933
|
+
this[propName] = values[propName];
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
};
|
|
890
937
|
}
|
|
891
|
-
function
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
938
|
+
function makeParamDecorator(name, props, parentClass) {
|
|
939
|
+
return noSideEffects(() => {
|
|
940
|
+
const metaCtor = makeMetadataCtor(props);
|
|
941
|
+
function ParamDecoratorFactory(...args) {
|
|
942
|
+
if (this instanceof ParamDecoratorFactory) {
|
|
943
|
+
metaCtor.apply(this, args);
|
|
944
|
+
return this;
|
|
945
|
+
}
|
|
946
|
+
const annotationInstance = new ParamDecoratorFactory(...args);
|
|
947
|
+
ParamDecorator.annotation = annotationInstance;
|
|
948
|
+
return ParamDecorator;
|
|
949
|
+
function ParamDecorator(cls, unusedKey, index) {
|
|
950
|
+
const parameters = cls.hasOwnProperty(PARAMETERS) ? cls[PARAMETERS] : Object.defineProperty(cls, PARAMETERS, {
|
|
951
|
+
value: []
|
|
952
|
+
})[PARAMETERS];
|
|
953
|
+
while (parameters.length <= index) {
|
|
954
|
+
parameters.push(null);
|
|
955
|
+
}
|
|
956
|
+
(parameters[index] = parameters[index] || []).push(annotationInstance);
|
|
957
|
+
return cls;
|
|
903
958
|
}
|
|
904
|
-
} finally {
|
|
905
|
-
setInjectImplementation(previousInjectImplementation);
|
|
906
959
|
}
|
|
907
|
-
|
|
908
|
-
|
|
960
|
+
ParamDecoratorFactory.prototype.ngMetadataName = name;
|
|
961
|
+
ParamDecoratorFactory.annotationCls = ParamDecoratorFactory;
|
|
962
|
+
return ParamDecoratorFactory;
|
|
963
|
+
});
|
|
909
964
|
}
|
|
910
|
-
function
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
if (
|
|
915
|
-
|
|
965
|
+
function makePropDecorator(name, props, parentClass, additionalProcessing) {
|
|
966
|
+
return noSideEffects(() => {
|
|
967
|
+
const metaCtor = makeMetadataCtor(props);
|
|
968
|
+
function PropDecoratorFactory(...args) {
|
|
969
|
+
if (this instanceof PropDecoratorFactory) {
|
|
970
|
+
metaCtor.apply(this, args);
|
|
971
|
+
return this;
|
|
972
|
+
}
|
|
973
|
+
const decoratorInstance = new PropDecoratorFactory(...args);
|
|
974
|
+
function PropDecorator(target, name) {
|
|
975
|
+
if (target === undefined) {
|
|
976
|
+
throw new Error('Standard Angular field decorators are not supported in JIT mode.');
|
|
977
|
+
}
|
|
978
|
+
const constructor = target.constructor;
|
|
979
|
+
const meta = constructor.hasOwnProperty(PROP_METADATA) ? constructor[PROP_METADATA] : Object.defineProperty(constructor, PROP_METADATA, {
|
|
980
|
+
value: {}
|
|
981
|
+
})[PROP_METADATA];
|
|
982
|
+
meta[name] = meta.hasOwnProperty(name) && meta[name] || [];
|
|
983
|
+
meta[name].unshift(decoratorInstance);
|
|
916
984
|
}
|
|
985
|
+
return PropDecorator;
|
|
917
986
|
}
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
return value;
|
|
987
|
+
if (parentClass) {
|
|
988
|
+
PropDecoratorFactory.prototype = Object.create(parentClass.prototype);
|
|
921
989
|
}
|
|
990
|
+
PropDecoratorFactory.prototype.ngMetadataName = name;
|
|
991
|
+
PropDecoratorFactory.annotationCls = PropDecoratorFactory;
|
|
992
|
+
return PropDecoratorFactory;
|
|
993
|
+
});
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
function getCompilerFacade(request) {
|
|
997
|
+
const globalNg = _global['ng'];
|
|
998
|
+
if (globalNg && globalNg.ɵcompilerFacade) {
|
|
999
|
+
return globalNg.ɵcompilerFacade;
|
|
1000
|
+
}
|
|
1001
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
1002
|
+
console.error(`JIT compilation failed for ${request.kind}`, request.type);
|
|
1003
|
+
let message = `The ${request.kind} '${request.type.name}' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.\n\n`;
|
|
1004
|
+
if (request.usage === 1) {
|
|
1005
|
+
message += `The ${request.kind} is part of a library that has been partially compiled.\n`;
|
|
1006
|
+
message += `However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.\n`;
|
|
1007
|
+
message += '\n';
|
|
1008
|
+
message += `Ideally, the library is processed using the Angular Linker to become fully AOT compiled.\n`;
|
|
1009
|
+
} else {
|
|
1010
|
+
message += `JIT compilation is discouraged for production use-cases! Consider using AOT mode instead.\n`;
|
|
1011
|
+
}
|
|
1012
|
+
message += `Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server',\n`;
|
|
1013
|
+
message += `or manually provide the compiler with 'import "@angular/compiler";' before bootstrapping.`;
|
|
1014
|
+
throw new Error(message);
|
|
1015
|
+
} else {
|
|
1016
|
+
throw new Error('JIT compiler unavailable');
|
|
922
1017
|
}
|
|
923
|
-
return lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);
|
|
924
1018
|
}
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
1019
|
+
|
|
1020
|
+
function ɵɵdefineService(opts) {
|
|
1021
|
+
return {
|
|
1022
|
+
token: opts.token,
|
|
1023
|
+
providedIn: opts.autoProvided === false ? null : 'root',
|
|
1024
|
+
factory: opts.factory,
|
|
1025
|
+
value: undefined
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
const angularCoreDiEnv = {
|
|
1030
|
+
'ɵɵdefineInjectable': __defineInjectable,
|
|
1031
|
+
'ɵɵdefineInjector': __defineInjector,
|
|
1032
|
+
'ɵɵdefineService': ɵɵdefineService,
|
|
1033
|
+
'ɵɵinject': __inject,
|
|
1034
|
+
'ɵɵinvalidFactoryDep': __invalidFactoryDep,
|
|
1035
|
+
'resolveForwardRef': resolveForwardRef
|
|
1036
|
+
};
|
|
1037
|
+
|
|
1038
|
+
const Type = Function;
|
|
1039
|
+
function isType(v) {
|
|
1040
|
+
return typeof v === 'function';
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
const ES5_DELEGATE_CTOR = /^function\s+\S+\(\)\s*{[\s\S]+\.apply\(this,\s*(arguments|(?:[^()]+\(\[\],)?[^()]+\(arguments\).*)\)/;
|
|
1044
|
+
const ES2015_INHERITED_CLASS = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{/;
|
|
1045
|
+
const ES2015_INHERITED_CLASS_WITH_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(/;
|
|
1046
|
+
const ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(\)\s*{[^}]*super\(\.\.\.arguments\)/;
|
|
1047
|
+
function isDelegateCtor(typeStr) {
|
|
1048
|
+
return ES5_DELEGATE_CTOR.test(typeStr) || ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) || ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr);
|
|
1049
|
+
}
|
|
1050
|
+
class ReflectionCapabilities {
|
|
1051
|
+
_reflect;
|
|
1052
|
+
constructor(reflect) {
|
|
1053
|
+
this._reflect = reflect || _global['Reflect'];
|
|
1054
|
+
}
|
|
1055
|
+
factory(t) {
|
|
1056
|
+
return (...args) => new t(...args);
|
|
1057
|
+
}
|
|
1058
|
+
_zipTypesAndAnnotations(paramTypes, paramAnnotations) {
|
|
1059
|
+
let result;
|
|
1060
|
+
if (typeof paramTypes === 'undefined') {
|
|
1061
|
+
result = newArray(paramAnnotations.length);
|
|
1062
|
+
} else {
|
|
1063
|
+
result = newArray(paramTypes.length);
|
|
930
1064
|
}
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
value = bloomHash(flags);
|
|
937
|
-
emitInstanceCreatedByInjectorEvent(value);
|
|
938
|
-
});
|
|
1065
|
+
for (let i = 0; i < result.length; i++) {
|
|
1066
|
+
if (typeof paramTypes === 'undefined') {
|
|
1067
|
+
result[i] = [];
|
|
1068
|
+
} else if (paramTypes[i] && paramTypes[i] != Object) {
|
|
1069
|
+
result[i] = [paramTypes[i]];
|
|
939
1070
|
} else {
|
|
940
|
-
|
|
1071
|
+
result[i] = [];
|
|
941
1072
|
}
|
|
942
|
-
if (
|
|
943
|
-
|
|
944
|
-
} else {
|
|
945
|
-
return value;
|
|
1073
|
+
if (paramAnnotations && paramAnnotations[i] != null) {
|
|
1074
|
+
result[i] = result[i].concat(paramAnnotations[i]);
|
|
946
1075
|
}
|
|
947
|
-
} finally {
|
|
948
|
-
leaveDI();
|
|
949
1076
|
}
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
parentLocation = injectorIndex === -1 ? getParentInjectorLocation(tNode, lView) : lView[injectorIndex + 8];
|
|
957
|
-
if (parentLocation === NO_PARENT_INJECTOR || !shouldSearchParent(flags, false)) {
|
|
958
|
-
injectorIndex = -1;
|
|
959
|
-
} else {
|
|
960
|
-
previousTView = lView[TVIEW];
|
|
961
|
-
injectorIndex = getParentInjectorIndex(parentLocation);
|
|
962
|
-
lView = getParentInjectorView(parentLocation, lView);
|
|
963
|
-
}
|
|
1077
|
+
return result;
|
|
1078
|
+
}
|
|
1079
|
+
_ownParameters(type, parentCtor) {
|
|
1080
|
+
const typeStr = type.toString();
|
|
1081
|
+
if (isDelegateCtor(typeStr)) {
|
|
1082
|
+
return null;
|
|
964
1083
|
}
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
const tView = lView[TVIEW];
|
|
968
|
-
ngDevMode && assertTNodeForLView(tView.data[injectorIndex + 8], lView);
|
|
969
|
-
if (bloomHasToken(bloomHash, injectorIndex, tView.data)) {
|
|
970
|
-
const instance = searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode);
|
|
971
|
-
if (instance !== NOT_FOUND) {
|
|
972
|
-
return instance;
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
parentLocation = lView[injectorIndex + 8];
|
|
976
|
-
if (parentLocation !== NO_PARENT_INJECTOR && shouldSearchParent(flags, lView[TVIEW].data[injectorIndex + 8] === hostTElementNode) && bloomHasToken(bloomHash, injectorIndex, lView)) {
|
|
977
|
-
previousTView = tView;
|
|
978
|
-
injectorIndex = getParentInjectorIndex(parentLocation);
|
|
979
|
-
lView = getParentInjectorView(parentLocation, lView);
|
|
980
|
-
} else {
|
|
981
|
-
injectorIndex = -1;
|
|
982
|
-
}
|
|
1084
|
+
if (type.parameters && type.parameters !== parentCtor.parameters) {
|
|
1085
|
+
return type.parameters;
|
|
983
1086
|
}
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
} else {
|
|
996
|
-
return NOT_FOUND;
|
|
997
|
-
}
|
|
998
|
-
}
|
|
999
|
-
function locateDirectiveOrProvider(tNode, tView, token, canAccessViewProviders, isHostSpecialCase) {
|
|
1000
|
-
const nodeProviderIndexes = tNode.providerIndexes;
|
|
1001
|
-
const tInjectables = tView.data;
|
|
1002
|
-
const injectablesStart = nodeProviderIndexes & 1048575;
|
|
1003
|
-
const directivesStart = tNode.directiveStart;
|
|
1004
|
-
const directiveEnd = tNode.directiveEnd;
|
|
1005
|
-
const cptViewProvidersCount = nodeProviderIndexes >> 20;
|
|
1006
|
-
const startingIndex = canAccessViewProviders ? injectablesStart : injectablesStart + cptViewProvidersCount;
|
|
1007
|
-
const endIndex = isHostSpecialCase ? injectablesStart + cptViewProvidersCount : directiveEnd;
|
|
1008
|
-
for (let i = startingIndex; i < endIndex; i++) {
|
|
1009
|
-
const providerTokenOrDef = tInjectables[i];
|
|
1010
|
-
if (i < directivesStart && token === providerTokenOrDef || i >= directivesStart && providerTokenOrDef.type === token) {
|
|
1011
|
-
return i;
|
|
1087
|
+
const tsickleCtorParams = type.ctorParameters;
|
|
1088
|
+
if (tsickleCtorParams && tsickleCtorParams !== parentCtor.ctorParameters) {
|
|
1089
|
+
const ctorParameters = typeof tsickleCtorParams === 'function' ? tsickleCtorParams() : tsickleCtorParams;
|
|
1090
|
+
const paramTypes = ctorParameters.map(ctorParam => ctorParam && ctorParam.type);
|
|
1091
|
+
const paramAnnotations = ctorParameters.map(ctorParam => ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators));
|
|
1092
|
+
return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);
|
|
1093
|
+
}
|
|
1094
|
+
const paramAnnotations = type.hasOwnProperty(PARAMETERS) && type[PARAMETERS];
|
|
1095
|
+
const paramTypes = this._reflect && this._reflect.getOwnMetadata && this._reflect.getOwnMetadata('design:paramtypes', type);
|
|
1096
|
+
if (paramTypes || paramAnnotations) {
|
|
1097
|
+
return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);
|
|
1012
1098
|
}
|
|
1099
|
+
return newArray(type.length);
|
|
1013
1100
|
}
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1101
|
+
parameters(type) {
|
|
1102
|
+
if (!isType(type)) {
|
|
1103
|
+
return [];
|
|
1104
|
+
}
|
|
1105
|
+
const parentCtor = getParentCtor(type);
|
|
1106
|
+
let parameters = this._ownParameters(type, parentCtor);
|
|
1107
|
+
if (!parameters && parentCtor !== Object) {
|
|
1108
|
+
parameters = this.parameters(parentCtor);
|
|
1018
1109
|
}
|
|
1110
|
+
return parameters || [];
|
|
1019
1111
|
}
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
let
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
const tData = tView.data;
|
|
1026
|
-
if (value instanceof NodeInjectorFactory) {
|
|
1027
|
-
const factory = value;
|
|
1028
|
-
ngDevMode && injectionPath.push(factory.name ?? 'unknown');
|
|
1029
|
-
if (factory.resolving) {
|
|
1030
|
-
let token = '';
|
|
1031
|
-
if (ngDevMode) {
|
|
1032
|
-
token = stringifyForError(tData[index]);
|
|
1033
|
-
throw cyclicDependencyErrorWithDetails(token, injectionPath);
|
|
1034
|
-
} else {
|
|
1035
|
-
throw cyclicDependencyError(token);
|
|
1112
|
+
_ownAnnotations(typeOrFunc, parentCtor) {
|
|
1113
|
+
if (typeOrFunc.annotations && typeOrFunc.annotations !== parentCtor.annotations) {
|
|
1114
|
+
let annotations = typeOrFunc.annotations;
|
|
1115
|
+
if (typeof annotations === 'function' && annotations.annotations) {
|
|
1116
|
+
annotations = annotations.annotations;
|
|
1036
1117
|
}
|
|
1118
|
+
return annotations;
|
|
1037
1119
|
}
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
const token = tData[index].type || tData[index];
|
|
1041
|
-
let prevInjectContext;
|
|
1042
|
-
if (ngDevMode) {
|
|
1043
|
-
const injector = new NodeInjector(tNode, lView);
|
|
1044
|
-
prevInjectContext = setInjectorProfilerContext({
|
|
1045
|
-
injector,
|
|
1046
|
-
token
|
|
1047
|
-
});
|
|
1120
|
+
if (typeOrFunc.decorators && typeOrFunc.decorators !== parentCtor.decorators) {
|
|
1121
|
+
return convertTsickleDecoratorIntoMetadata(typeOrFunc.decorators);
|
|
1048
1122
|
}
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
ngDevMode && assertEqual(success, true, "Because flags do not contain `SkipSelf' we expect this to always succeed.");
|
|
1052
|
-
try {
|
|
1053
|
-
ngDevMode && emitInjectorToCreateInstanceEvent(token);
|
|
1054
|
-
value = lView[index] = factory.factory(undefined, flags, tData, lView, tNode);
|
|
1055
|
-
ngDevMode && emitInstanceCreatedByInjectorEvent(value);
|
|
1056
|
-
if (tView.firstCreatePass && index >= tNode.directiveStart) {
|
|
1057
|
-
ngDevMode && assertDirectiveDef(tData[index]);
|
|
1058
|
-
registerPreOrderHooks(index, tData[index], tView);
|
|
1059
|
-
}
|
|
1060
|
-
} finally {
|
|
1061
|
-
ngDevMode && setInjectorProfilerContext(prevInjectContext);
|
|
1062
|
-
previousInjectImplementation !== null && setInjectImplementation(previousInjectImplementation);
|
|
1063
|
-
setIncludeViewProviders(previousIncludeViewProviders);
|
|
1064
|
-
factory.resolving = false;
|
|
1065
|
-
leaveDI();
|
|
1066
|
-
ngDevMode && (injectionPath = []);
|
|
1123
|
+
if (typeOrFunc.hasOwnProperty(ANNOTATIONS)) {
|
|
1124
|
+
return typeOrFunc[ANNOTATIONS];
|
|
1067
1125
|
}
|
|
1126
|
+
return null;
|
|
1068
1127
|
}
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
ngDevMode && assertDefined(token, 'token must be defined');
|
|
1073
|
-
if (typeof token === 'string') {
|
|
1074
|
-
return token.charCodeAt(0) || 0;
|
|
1075
|
-
}
|
|
1076
|
-
const tokenId = token.hasOwnProperty(NG_ELEMENT_ID) ? token[NG_ELEMENT_ID] : undefined;
|
|
1077
|
-
if (typeof tokenId === 'number') {
|
|
1078
|
-
if (tokenId >= 0) {
|
|
1079
|
-
return tokenId & BLOOM_MASK;
|
|
1080
|
-
} else {
|
|
1081
|
-
ngDevMode && assertEqual(tokenId, -1, 'Expecting to get Special Injector Id');
|
|
1082
|
-
return createNodeInjector;
|
|
1128
|
+
annotations(typeOrFunc) {
|
|
1129
|
+
if (!isType(typeOrFunc)) {
|
|
1130
|
+
return [];
|
|
1083
1131
|
}
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
function bloomHasToken(bloomHash, injectorIndex, injectorView) {
|
|
1089
|
-
const mask = 1 << bloomHash;
|
|
1090
|
-
const value = injectorView[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)];
|
|
1091
|
-
return !!(value & mask);
|
|
1092
|
-
}
|
|
1093
|
-
function shouldSearchParent(flags, isFirstHostTNode) {
|
|
1094
|
-
return !(flags & 2) && !(flags & 1 && isFirstHostTNode);
|
|
1095
|
-
}
|
|
1096
|
-
function getNodeInjectorLView(nodeInjector) {
|
|
1097
|
-
return nodeInjector._lView;
|
|
1098
|
-
}
|
|
1099
|
-
function getNodeInjectorTNode(nodeInjector) {
|
|
1100
|
-
return nodeInjector._tNode;
|
|
1101
|
-
}
|
|
1102
|
-
class NodeInjector {
|
|
1103
|
-
_tNode;
|
|
1104
|
-
_lView;
|
|
1105
|
-
constructor(_tNode, _lView) {
|
|
1106
|
-
this._tNode = _tNode;
|
|
1107
|
-
this._lView = _lView;
|
|
1108
|
-
}
|
|
1109
|
-
get(token, notFoundValue, flags) {
|
|
1110
|
-
return getOrCreateInjectable(this._tNode, this._lView, token, convertToBitFlags(flags), notFoundValue);
|
|
1132
|
+
const parentCtor = getParentCtor(typeOrFunc);
|
|
1133
|
+
const ownAnnotations = this._ownAnnotations(typeOrFunc, parentCtor) || [];
|
|
1134
|
+
const parentAnnotations = parentCtor !== Object ? this.annotations(parentCtor) : [];
|
|
1135
|
+
return parentAnnotations.concat(ownAnnotations);
|
|
1111
1136
|
}
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
return noSideEffects(() => {
|
|
1118
|
-
const ownConstructor = type.prototype.constructor;
|
|
1119
|
-
const ownFactory = ownConstructor[NG_FACTORY_DEF] || getFactoryOf(ownConstructor);
|
|
1120
|
-
const objectPrototype = Object.prototype;
|
|
1121
|
-
let parent = Object.getPrototypeOf(type.prototype).constructor;
|
|
1122
|
-
while (parent && parent !== objectPrototype) {
|
|
1123
|
-
const factory = parent[NG_FACTORY_DEF] || getFactoryOf(parent);
|
|
1124
|
-
if (factory && factory !== ownFactory) {
|
|
1125
|
-
return factory;
|
|
1137
|
+
_ownPropMetadata(typeOrFunc, parentCtor) {
|
|
1138
|
+
if (typeOrFunc.propMetadata && typeOrFunc.propMetadata !== parentCtor.propMetadata) {
|
|
1139
|
+
let propMetadata = typeOrFunc.propMetadata;
|
|
1140
|
+
if (typeof propMetadata === 'function' && propMetadata.propMetadata) {
|
|
1141
|
+
propMetadata = propMetadata.propMetadata;
|
|
1126
1142
|
}
|
|
1127
|
-
|
|
1143
|
+
return propMetadata;
|
|
1128
1144
|
}
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
}
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1145
|
+
if (typeOrFunc.propDecorators && typeOrFunc.propDecorators !== parentCtor.propDecorators) {
|
|
1146
|
+
const propDecorators = typeOrFunc.propDecorators;
|
|
1147
|
+
const propMetadata = {};
|
|
1148
|
+
Object.keys(propDecorators).forEach(prop => {
|
|
1149
|
+
propMetadata[prop] = convertTsickleDecoratorIntoMetadata(propDecorators[prop]);
|
|
1150
|
+
});
|
|
1151
|
+
return propMetadata;
|
|
1152
|
+
}
|
|
1153
|
+
if (typeOrFunc.hasOwnProperty(PROP_METADATA)) {
|
|
1154
|
+
return typeOrFunc[PROP_METADATA];
|
|
1155
|
+
}
|
|
1156
|
+
return null;
|
|
1138
1157
|
}
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
let currentTNode = tNode;
|
|
1143
|
-
let currentLView = lView;
|
|
1144
|
-
while (currentTNode !== null && currentLView !== null && currentLView[FLAGS] & 2048 && !isRootView(currentLView)) {
|
|
1145
|
-
ngDevMode && assertTNodeForLView(currentTNode, currentLView);
|
|
1146
|
-
const nodeInjectorValue = lookupTokenUsingNodeInjector(currentTNode, currentLView, token, flags | 2, NOT_FOUND);
|
|
1147
|
-
if (nodeInjectorValue !== NOT_FOUND) {
|
|
1148
|
-
return nodeInjectorValue;
|
|
1158
|
+
propMetadata(typeOrFunc) {
|
|
1159
|
+
if (!isType(typeOrFunc)) {
|
|
1160
|
+
return {};
|
|
1149
1161
|
}
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1162
|
+
const parentCtor = getParentCtor(typeOrFunc);
|
|
1163
|
+
const propMetadata = {};
|
|
1164
|
+
if (parentCtor !== Object) {
|
|
1165
|
+
const parentPropMetadata = this.propMetadata(parentCtor);
|
|
1166
|
+
Object.keys(parentPropMetadata).forEach(propName => {
|
|
1167
|
+
propMetadata[propName] = parentPropMetadata[propName];
|
|
1168
|
+
});
|
|
1169
|
+
}
|
|
1170
|
+
const ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor);
|
|
1171
|
+
if (ownPropMetadata) {
|
|
1172
|
+
Object.keys(ownPropMetadata).forEach(propName => {
|
|
1173
|
+
const decorators = [];
|
|
1174
|
+
if (propMetadata.hasOwnProperty(propName)) {
|
|
1175
|
+
decorators.push(...propMetadata[propName]);
|
|
1157
1176
|
}
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1177
|
+
decorators.push(...ownPropMetadata[propName]);
|
|
1178
|
+
propMetadata[propName] = decorators;
|
|
1179
|
+
});
|
|
1161
1180
|
}
|
|
1162
|
-
|
|
1181
|
+
return propMetadata;
|
|
1182
|
+
}
|
|
1183
|
+
ownPropMetadata(typeOrFunc) {
|
|
1184
|
+
if (!isType(typeOrFunc)) {
|
|
1185
|
+
return {};
|
|
1186
|
+
}
|
|
1187
|
+
return this._ownPropMetadata(typeOrFunc, getParentCtor(typeOrFunc)) || {};
|
|
1188
|
+
}
|
|
1189
|
+
hasLifecycleHook(type, lcProperty) {
|
|
1190
|
+
return type instanceof Type && lcProperty in type.prototype;
|
|
1163
1191
|
}
|
|
1164
|
-
return notFoundValue;
|
|
1165
1192
|
}
|
|
1166
|
-
function
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
if (tViewType === 2) {
|
|
1170
|
-
ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');
|
|
1171
|
-
return tView.declTNode;
|
|
1172
|
-
} else if (tViewType === 1) {
|
|
1173
|
-
return lView[T_HOST];
|
|
1193
|
+
function convertTsickleDecoratorIntoMetadata(decoratorInvocations) {
|
|
1194
|
+
if (!decoratorInvocations) {
|
|
1195
|
+
return [];
|
|
1174
1196
|
}
|
|
1175
|
-
return
|
|
1197
|
+
return decoratorInvocations.map(decoratorInvocation => {
|
|
1198
|
+
const decoratorType = decoratorInvocation.type;
|
|
1199
|
+
const annotationCls = decoratorType.annotationCls;
|
|
1200
|
+
const annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];
|
|
1201
|
+
return new annotationCls(...annotationArgs);
|
|
1202
|
+
});
|
|
1176
1203
|
}
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1204
|
+
function getParentCtor(ctor) {
|
|
1205
|
+
const parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null;
|
|
1206
|
+
const parentCtor = parentProto ? parentProto.constructor : null;
|
|
1207
|
+
return parentCtor || Object;
|
|
1180
1208
|
}
|
|
1181
1209
|
|
|
1210
|
+
const Inject = attachInjectFlag(makeParamDecorator('Inject', token => ({
|
|
1211
|
+
token
|
|
1212
|
+
})), -1);
|
|
1213
|
+
const Optional = attachInjectFlag(makeParamDecorator('Optional'), 8);
|
|
1214
|
+
const Self = attachInjectFlag(makeParamDecorator('Self'), 2);
|
|
1215
|
+
const SkipSelf = attachInjectFlag(makeParamDecorator('SkipSelf'), 4);
|
|
1216
|
+
const Host = attachInjectFlag(makeParamDecorator('Host'), 1);
|
|
1217
|
+
|
|
1182
1218
|
const Attribute = makeParamDecorator('Attribute', attributeName => ({
|
|
1183
1219
|
attributeName,
|
|
1184
1220
|
__NG_ELEMENT_ID__: () => ɵɵinjectAttribute(attributeName)
|
|
@@ -1321,6 +1357,60 @@ function getInjectableMetadata(type, srcMeta) {
|
|
|
1321
1357
|
|
|
1322
1358
|
const Injectable = makeDecorator('Injectable', undefined, undefined, undefined, (type, meta) => compileInjectable(type, meta));
|
|
1323
1359
|
|
|
1360
|
+
function compileService(type, meta) {
|
|
1361
|
+
let def = null;
|
|
1362
|
+
let factoryDef = null;
|
|
1363
|
+
if (!type.hasOwnProperty(NG_PROV_DEF)) {
|
|
1364
|
+
Object.defineProperty(type, NG_PROV_DEF, {
|
|
1365
|
+
get: () => {
|
|
1366
|
+
if (def === null) {
|
|
1367
|
+
const compiler = getCompilerFacade({
|
|
1368
|
+
usage: 0,
|
|
1369
|
+
kind: 'service',
|
|
1370
|
+
type
|
|
1371
|
+
});
|
|
1372
|
+
def = compiler.compileService(angularCoreDiEnv, `ng:///${type.name}/ɵprov.js`, getServiceMetadata(type, meta));
|
|
1373
|
+
}
|
|
1374
|
+
return def;
|
|
1375
|
+
}
|
|
1376
|
+
});
|
|
1377
|
+
}
|
|
1378
|
+
if (!type.hasOwnProperty(NG_FACTORY_DEF)) {
|
|
1379
|
+
Object.defineProperty(type, NG_FACTORY_DEF, {
|
|
1380
|
+
get: () => {
|
|
1381
|
+
if (factoryDef === null) {
|
|
1382
|
+
const compiler = getCompilerFacade({
|
|
1383
|
+
usage: 0,
|
|
1384
|
+
kind: 'service',
|
|
1385
|
+
type
|
|
1386
|
+
});
|
|
1387
|
+
factoryDef = compiler.compileFactory(angularCoreDiEnv, `ng:///${type.name}/ɵfac.js`, {
|
|
1388
|
+
name: type.name,
|
|
1389
|
+
type,
|
|
1390
|
+
typeArgumentCount: 0,
|
|
1391
|
+
deps: reflectDependencies(type),
|
|
1392
|
+
target: compiler.FactoryTarget.Service
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1395
|
+
return factoryDef;
|
|
1396
|
+
},
|
|
1397
|
+
configurable: true
|
|
1398
|
+
});
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
function getServiceMetadata(type, srcMeta) {
|
|
1402
|
+
const compilerMeta = {
|
|
1403
|
+
name: type.name,
|
|
1404
|
+
type: type,
|
|
1405
|
+
typeArgumentCount: 0,
|
|
1406
|
+
autoProvided: srcMeta?.autoProvided,
|
|
1407
|
+
factory: srcMeta?.factory
|
|
1408
|
+
};
|
|
1409
|
+
return compilerMeta;
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
const Service = makeDecorator('Service', undefined, undefined, undefined, (type, meta) => compileService(type, meta));
|
|
1413
|
+
|
|
1324
1414
|
function injectElementRef() {
|
|
1325
1415
|
return createElementRef(getCurrentTNode(), getLView());
|
|
1326
1416
|
}
|
|
@@ -1334,6 +1424,9 @@ class ElementRef {
|
|
|
1334
1424
|
}
|
|
1335
1425
|
static __NG_ELEMENT_ID__ = injectElementRef;
|
|
1336
1426
|
}
|
|
1427
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
1428
|
+
registerSpecialProvider(ElementRef);
|
|
1429
|
+
}
|
|
1337
1430
|
function unwrapElementRef(value) {
|
|
1338
1431
|
return value instanceof ElementRef ? value.nativeElement : value;
|
|
1339
1432
|
}
|
|
@@ -1975,104 +2068,6 @@ function getDocument() {
|
|
|
1975
2068
|
throw new RuntimeError(210, (typeof ngDevMode === 'undefined' || ngDevMode) && `The document object is not available in this context. Make sure the DOCUMENT injection token is provided.`);
|
|
1976
2069
|
}
|
|
1977
2070
|
|
|
1978
|
-
const APP_ID = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'AppId' : '', {
|
|
1979
|
-
factory: () => DEFAULT_APP_ID
|
|
1980
|
-
});
|
|
1981
|
-
const DEFAULT_APP_ID = 'ng';
|
|
1982
|
-
const validAppIdInitializer = {
|
|
1983
|
-
provide: ENVIRONMENT_INITIALIZER,
|
|
1984
|
-
multi: true,
|
|
1985
|
-
useValue: () => {
|
|
1986
|
-
const appId = inject(APP_ID);
|
|
1987
|
-
const isAlphanumeric = /^[a-zA-Z0-9\-_]+$/.test(appId);
|
|
1988
|
-
if (!isAlphanumeric) {
|
|
1989
|
-
throw new RuntimeError(211, `APP_ID value "${appId}" is not alphanumeric. ` + `The APP_ID must be a string of alphanumeric characters. (a-zA-Z0-9), hyphens (-) and underscores (_) are allowed.`);
|
|
1990
|
-
}
|
|
1991
|
-
}
|
|
1992
|
-
};
|
|
1993
|
-
const PLATFORM_INITIALIZER = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'Platform Initializer' : '');
|
|
1994
|
-
const PLATFORM_ID = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'Platform ID' : '', {
|
|
1995
|
-
providedIn: 'platform',
|
|
1996
|
-
factory: () => 'unknown'
|
|
1997
|
-
});
|
|
1998
|
-
const ANIMATION_MODULE_TYPE = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'AnimationModuleType' : '');
|
|
1999
|
-
const CSP_NONCE = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'CSP nonce' : '', {
|
|
2000
|
-
factory: () => {
|
|
2001
|
-
return inject(DOCUMENT$1).body?.querySelector('[ngCspNonce]')?.getAttribute('ngCspNonce') || null;
|
|
2002
|
-
}
|
|
2003
|
-
});
|
|
2004
|
-
const IMAGE_CONFIG_DEFAULTS = {
|
|
2005
|
-
breakpoints: [16, 32, 48, 64, 96, 128, 256, 384, 640, 750, 828, 1080, 1200, 1920, 2048, 3840],
|
|
2006
|
-
placeholderResolution: 30,
|
|
2007
|
-
disableImageSizeWarning: false,
|
|
2008
|
-
disableImageLazyLoadWarning: false
|
|
2009
|
-
};
|
|
2010
|
-
const IMAGE_CONFIG = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'ImageConfig' : '', {
|
|
2011
|
-
factory: () => IMAGE_CONFIG_DEFAULTS
|
|
2012
|
-
});
|
|
2013
|
-
|
|
2014
|
-
function makeStateKey(key) {
|
|
2015
|
-
return key;
|
|
2016
|
-
}
|
|
2017
|
-
class TransferState {
|
|
2018
|
-
static ɵprov =
|
|
2019
|
-
/* @__PURE__ */
|
|
2020
|
-
__defineInjectable({
|
|
2021
|
-
token: TransferState,
|
|
2022
|
-
providedIn: 'root',
|
|
2023
|
-
factory: () => {
|
|
2024
|
-
const transferState = new TransferState();
|
|
2025
|
-
if (typeof ngServerMode === 'undefined' || !ngServerMode) {
|
|
2026
|
-
transferState.store = retrieveTransferredState(inject(DOCUMENT$1), inject(APP_ID));
|
|
2027
|
-
}
|
|
2028
|
-
return transferState;
|
|
2029
|
-
}
|
|
2030
|
-
});
|
|
2031
|
-
store = {};
|
|
2032
|
-
onSerializeCallbacks = {};
|
|
2033
|
-
get(key, defaultValue) {
|
|
2034
|
-
return this.store[key] !== undefined ? this.store[key] : defaultValue;
|
|
2035
|
-
}
|
|
2036
|
-
set(key, value) {
|
|
2037
|
-
this.store[key] = value;
|
|
2038
|
-
}
|
|
2039
|
-
remove(key) {
|
|
2040
|
-
delete this.store[key];
|
|
2041
|
-
}
|
|
2042
|
-
hasKey(key) {
|
|
2043
|
-
return this.store.hasOwnProperty(key);
|
|
2044
|
-
}
|
|
2045
|
-
get isEmpty() {
|
|
2046
|
-
return Object.keys(this.store).length === 0;
|
|
2047
|
-
}
|
|
2048
|
-
onSerialize(key, callback) {
|
|
2049
|
-
this.onSerializeCallbacks[key] = callback;
|
|
2050
|
-
}
|
|
2051
|
-
toJson() {
|
|
2052
|
-
for (const key in this.onSerializeCallbacks) {
|
|
2053
|
-
if (this.onSerializeCallbacks.hasOwnProperty(key)) {
|
|
2054
|
-
try {
|
|
2055
|
-
this.store[key] = this.onSerializeCallbacks[key]();
|
|
2056
|
-
} catch (e) {
|
|
2057
|
-
console.warn('Exception in onSerialize callback: ', e);
|
|
2058
|
-
}
|
|
2059
|
-
}
|
|
2060
|
-
}
|
|
2061
|
-
return JSON.stringify(this.store).replace(/</g, '\\u003C').replace(/\//g, '\\u002F');
|
|
2062
|
-
}
|
|
2063
|
-
}
|
|
2064
|
-
function retrieveTransferredState(doc, appId) {
|
|
2065
|
-
const script = doc.getElementById(appId + '-state');
|
|
2066
|
-
if (script?.textContent) {
|
|
2067
|
-
try {
|
|
2068
|
-
return JSON.parse(script.textContent);
|
|
2069
|
-
} catch (e) {
|
|
2070
|
-
console.warn('Exception while restoring TransferState for app ' + appId, e);
|
|
2071
|
-
}
|
|
2072
|
-
}
|
|
2073
|
-
return {};
|
|
2074
|
-
}
|
|
2075
|
-
|
|
2076
2071
|
const REFERENCE_NODE_HOST = 'h';
|
|
2077
2072
|
const REFERENCE_NODE_BODY = 'b';
|
|
2078
2073
|
const NODE_NAVIGATION_STEP_FIRST_CHILD = 'f';
|
|
@@ -2289,11 +2284,24 @@ const removeListeners = el => {
|
|
|
2289
2284
|
const JSACTION_EVENT_CONTRACT = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'EVENT_CONTRACT_DETAILS' : '', {
|
|
2290
2285
|
factory: () => ({})
|
|
2291
2286
|
});
|
|
2287
|
+
const handledEventElements = new WeakMap();
|
|
2288
|
+
function markEventHandledForElement(event, element) {
|
|
2289
|
+
if (event == null || typeof event !== 'object') return;
|
|
2290
|
+
let elements = handledEventElements.get(event);
|
|
2291
|
+
if (!elements) {
|
|
2292
|
+
elements = new WeakSet();
|
|
2293
|
+
handledEventElements.set(event, elements);
|
|
2294
|
+
}
|
|
2295
|
+
elements.add(element);
|
|
2296
|
+
}
|
|
2292
2297
|
function invokeListeners(event, currentTarget) {
|
|
2293
2298
|
const handlerFns = currentTarget?.__jsaction_fns?.get(event.type);
|
|
2294
2299
|
if (!handlerFns || !currentTarget?.isConnected) {
|
|
2295
2300
|
return;
|
|
2296
2301
|
}
|
|
2302
|
+
if (currentTarget && handledEventElements.get(event)?.has(currentTarget)) {
|
|
2303
|
+
return;
|
|
2304
|
+
}
|
|
2297
2305
|
for (const handler of handlerFns) {
|
|
2298
2306
|
handler(event);
|
|
2299
2307
|
}
|
|
@@ -3457,12 +3465,6 @@ function validateAgainstEventProperties(name) {
|
|
|
3457
3465
|
throw new RuntimeError(306, errorMessage);
|
|
3458
3466
|
}
|
|
3459
3467
|
}
|
|
3460
|
-
function validateAgainstEventAttributes(name) {
|
|
3461
|
-
if (name.toLowerCase().startsWith('on')) {
|
|
3462
|
-
const errorMessage = `Binding to event attribute '${name}' is disallowed for security reasons, ` + `please use (${name.slice(2)})=...`;
|
|
3463
|
-
throw new RuntimeError(306, errorMessage);
|
|
3464
|
-
}
|
|
3465
|
-
}
|
|
3466
3468
|
function getSanitizer() {
|
|
3467
3469
|
const lView = getLView();
|
|
3468
3470
|
return lView && lView[ENVIRONMENT].sanitizer;
|
|
@@ -5316,7 +5318,9 @@ function setDomProperty(tNode, lView, propName, value, renderer, sanitizer) {
|
|
|
5316
5318
|
if (tNode.type & 3) {
|
|
5317
5319
|
const element = getNativeByTNode(tNode, lView);
|
|
5318
5320
|
if (ngDevMode) {
|
|
5319
|
-
|
|
5321
|
+
if (lView[TVIEW].firstUpdatePass) {
|
|
5322
|
+
validateAgainstEventProperties(propName);
|
|
5323
|
+
}
|
|
5320
5324
|
if (!isPropertyValid(element, propName, tNode.value, lView[TVIEW].schemas)) {
|
|
5321
5325
|
handleUnknownPropertyError(propName, tNode.value, tNode.type, lView);
|
|
5322
5326
|
}
|
|
@@ -5458,7 +5462,6 @@ function findDirectiveDefMatches(tView, tNode) {
|
|
|
5458
5462
|
function elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace) {
|
|
5459
5463
|
if (ngDevMode) {
|
|
5460
5464
|
assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');
|
|
5461
|
-
validateAgainstEventAttributes(name);
|
|
5462
5465
|
assertTNodeType(tNode, 2, `Attempted to set attribute \`${name}\` on a container node. ` + `Host bindings are not valid on ng-container or ng-template.`);
|
|
5463
5466
|
}
|
|
5464
5467
|
const element = getNativeByTNode(tNode, lView);
|
|
@@ -7641,6 +7644,9 @@ class Renderer2 {
|
|
|
7641
7644
|
destroyNode = null;
|
|
7642
7645
|
static __NG_ELEMENT_ID__ = () => injectRenderer2();
|
|
7643
7646
|
}
|
|
7647
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
7648
|
+
registerSpecialProvider(Renderer2);
|
|
7649
|
+
}
|
|
7644
7650
|
function injectRenderer2() {
|
|
7645
7651
|
const lView = getLView();
|
|
7646
7652
|
const tNode = getCurrentTNode();
|
|
@@ -8034,6 +8040,10 @@ function bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {
|
|
|
8034
8040
|
|
|
8035
8041
|
function wrapListener(tNode, lView, listenerFn) {
|
|
8036
8042
|
return function wrapListenerIn_markDirtyAndPreventDefault(event) {
|
|
8043
|
+
const nativeEl = wrapListenerIn_markDirtyAndPreventDefault.__ngNativeEl__;
|
|
8044
|
+
if (nativeEl !== undefined) {
|
|
8045
|
+
markEventHandledForElement(event, nativeEl);
|
|
8046
|
+
}
|
|
8037
8047
|
const startView = isComponentHost(tNode) ? getComponentLViewByIndex(tNode.index, lView) : lView;
|
|
8038
8048
|
markViewDirty(startView, 5);
|
|
8039
8049
|
const context = lView[CONTEXT];
|
|
@@ -8076,6 +8086,9 @@ function listenToDomEvent(tNode, tView, lView, eventTargetResolver, renderer, ev
|
|
|
8076
8086
|
const native = getNativeByTNode(tNode, lView);
|
|
8077
8087
|
const target = eventTargetResolver ? eventTargetResolver(native) : native;
|
|
8078
8088
|
stashEventListenerImpl(lView, target, eventName, wrappedListener);
|
|
8089
|
+
if (!eventTargetResolver) {
|
|
8090
|
+
wrappedListener.__ngNativeEl__ = native;
|
|
8091
|
+
}
|
|
8079
8092
|
const cleanupFn = renderer.listen(target, eventName, wrappedListener);
|
|
8080
8093
|
if (!isAnimationEventType(eventName)) {
|
|
8081
8094
|
const idxOrTargetGetter = eventTargetResolver ? _lView => eventTargetResolver(unwrapRNode(_lView[tNode.index])) : tNode.index;
|
|
@@ -9010,7 +9023,7 @@ class ComponentFactory {
|
|
|
9010
9023
|
}
|
|
9011
9024
|
}
|
|
9012
9025
|
function createRootTView(rootSelectorOrNode, componentDef, componentBindings, directives) {
|
|
9013
|
-
const tAttributes = rootSelectorOrNode ? ['ng-version', '22.0.0-
|
|
9026
|
+
const tAttributes = rootSelectorOrNode ? ['ng-version', '22.0.0-rc.0'] : extractAttrsAndClassesFromSelector(componentDef.selectors[0]);
|
|
9014
9027
|
let creationBindings = null;
|
|
9015
9028
|
let updateBindings = null;
|
|
9016
9029
|
let varsToAllocate = 0;
|
|
@@ -9155,6 +9168,9 @@ function projectNodes(tNode, ngContentSelectors, projectableNodes) {
|
|
|
9155
9168
|
class ViewContainerRef {
|
|
9156
9169
|
static __NG_ELEMENT_ID__ = injectViewContainerRef;
|
|
9157
9170
|
}
|
|
9171
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
9172
|
+
registerSpecialProvider(ViewContainerRef);
|
|
9173
|
+
}
|
|
9158
9174
|
function injectViewContainerRef() {
|
|
9159
9175
|
const previousTNode = getCurrentTNode();
|
|
9160
9176
|
return createContainerRef(previousTNode, getLView());
|
|
@@ -10110,15 +10126,19 @@ function getComponentId(componentDef) {
|
|
|
10110
10126
|
}
|
|
10111
10127
|
|
|
10112
10128
|
const ASYNC_COMPONENT_METADATA_FN = '__ngAsyncComponentMetadataFn__';
|
|
10129
|
+
const ASYNC_METADATA_LOADED = '__ngAsyncMetadataLoaded__';
|
|
10113
10130
|
function getAsyncClassMetadataFn(type) {
|
|
10114
10131
|
const componentClass = type;
|
|
10132
|
+
if (componentClass[ASYNC_COMPONENT_METADATA_FN] === ASYNC_METADATA_LOADED) {
|
|
10133
|
+
return null;
|
|
10134
|
+
}
|
|
10115
10135
|
return componentClass[ASYNC_COMPONENT_METADATA_FN] ?? null;
|
|
10116
10136
|
}
|
|
10117
10137
|
function setClassMetadataAsync(type, dependencyLoaderFn, metadataSetterFn) {
|
|
10118
10138
|
const componentClass = type;
|
|
10119
10139
|
componentClass[ASYNC_COMPONENT_METADATA_FN] = () => Promise.all(dependencyLoaderFn()).then(dependencies => {
|
|
10120
10140
|
metadataSetterFn(...dependencies);
|
|
10121
|
-
componentClass[ASYNC_COMPONENT_METADATA_FN] =
|
|
10141
|
+
componentClass[ASYNC_COMPONENT_METADATA_FN] = ASYNC_METADATA_LOADED;
|
|
10122
10142
|
return dependencies;
|
|
10123
10143
|
});
|
|
10124
10144
|
return componentClass[ASYNC_COMPONENT_METADATA_FN];
|
|
@@ -10211,18 +10231,14 @@ class ApplicationInitStatus {
|
|
|
10211
10231
|
static ɵfac = function ApplicationInitStatus_Factory(__ngFactoryType__) {
|
|
10212
10232
|
return new (__ngFactoryType__ || ApplicationInitStatus)();
|
|
10213
10233
|
};
|
|
10214
|
-
static ɵprov = /*@__PURE__
|
|
10234
|
+
static ɵprov = /*@__PURE__*/ɵɵdefineService({
|
|
10215
10235
|
token: ApplicationInitStatus,
|
|
10216
|
-
factory: ApplicationInitStatus.ɵfac
|
|
10217
|
-
providedIn: 'root'
|
|
10236
|
+
factory: ApplicationInitStatus.ɵfac
|
|
10218
10237
|
});
|
|
10219
10238
|
}
|
|
10220
10239
|
(() => {
|
|
10221
10240
|
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationInitStatus, [{
|
|
10222
|
-
type:
|
|
10223
|
-
args: [{
|
|
10224
|
-
providedIn: 'root'
|
|
10225
|
-
}]
|
|
10241
|
+
type: Service
|
|
10226
10242
|
}], () => [], null);
|
|
10227
10243
|
})();
|
|
10228
10244
|
|
|
@@ -10952,28 +10968,6 @@ function registerDomTrigger(initialLView, tNode, triggerIndex, walkUpTimes, regi
|
|
|
10952
10968
|
});
|
|
10953
10969
|
}
|
|
10954
10970
|
|
|
10955
|
-
const _requestIdleCallback = () => (typeof requestIdleCallback !== 'undefined' ? requestIdleCallback : cb => setTimeout(cb)).bind(globalThis);
|
|
10956
|
-
const _cancelIdleCallback = () => (typeof requestIdleCallback !== 'undefined' ? cancelIdleCallback : clearTimeout).bind(globalThis);
|
|
10957
|
-
const IDLE_SERVICE = new InjectionToken(ngDevMode ? 'IDLE_SERVICE' : '', {
|
|
10958
|
-
factory: () => new RequestIdleCallbackService()
|
|
10959
|
-
});
|
|
10960
|
-
function provideIdleServiceWith(useExisting) {
|
|
10961
|
-
return makeEnvironmentProviders([{
|
|
10962
|
-
provide: IDLE_SERVICE,
|
|
10963
|
-
useExisting
|
|
10964
|
-
}]);
|
|
10965
|
-
}
|
|
10966
|
-
class RequestIdleCallbackService {
|
|
10967
|
-
requestIdleCallback = _requestIdleCallback();
|
|
10968
|
-
cancelIdleCallback = _cancelIdleCallback();
|
|
10969
|
-
requestOnIdle(callback, options) {
|
|
10970
|
-
return this.requestIdleCallback(callback, options);
|
|
10971
|
-
}
|
|
10972
|
-
cancelOnIdle(id) {
|
|
10973
|
-
return this.cancelIdleCallback(id);
|
|
10974
|
-
}
|
|
10975
|
-
}
|
|
10976
|
-
|
|
10977
10971
|
class Console {
|
|
10978
10972
|
log(message) {
|
|
10979
10973
|
console.log(message);
|
|
@@ -11490,7 +11484,13 @@ function getNodeInjectorProviders(injector) {
|
|
|
11490
11484
|
const {
|
|
11491
11485
|
resolverToProviders
|
|
11492
11486
|
} = getFrameworkDIDebugData();
|
|
11493
|
-
|
|
11487
|
+
const existingProviders = resolverToProviders.get(diResolver) ?? [];
|
|
11488
|
+
const specialProviders = Array.from(getAllSpecialProviders()).map(token => ({
|
|
11489
|
+
token: token,
|
|
11490
|
+
isViewProvider: false,
|
|
11491
|
+
provider: token
|
|
11492
|
+
}));
|
|
11493
|
+
return [...existingProviders, ...specialProviders];
|
|
11494
11494
|
}
|
|
11495
11495
|
function getProviderImportPaths(providerImportsContainer) {
|
|
11496
11496
|
const providerToPath = new Map();
|
|
@@ -11799,7 +11799,7 @@ let counter = 0;
|
|
|
11799
11799
|
const eventsStack = [];
|
|
11800
11800
|
function getBaseDocUrl() {
|
|
11801
11801
|
const full = VERSION.full;
|
|
11802
|
-
const isPreRelease = full.includes('-next') || full.includes('-rc') || full === '22.0.0-
|
|
11802
|
+
const isPreRelease = full.includes('-next') || full.includes('-rc') || full === '22.0.0-rc.0';
|
|
11803
11803
|
const prefix = isPreRelease ? 'next' : `v${VERSION.major}`;
|
|
11804
11804
|
return `https://${prefix}.angular.dev`;
|
|
11805
11805
|
}
|
|
@@ -12514,18 +12514,14 @@ class ApplicationRef {
|
|
|
12514
12514
|
static ɵfac = function ApplicationRef_Factory(__ngFactoryType__) {
|
|
12515
12515
|
return new (__ngFactoryType__ || ApplicationRef)();
|
|
12516
12516
|
};
|
|
12517
|
-
static ɵprov = /*@__PURE__
|
|
12517
|
+
static ɵprov = /*@__PURE__*/ɵɵdefineService({
|
|
12518
12518
|
token: ApplicationRef,
|
|
12519
|
-
factory: ApplicationRef.ɵfac
|
|
12520
|
-
providedIn: 'root'
|
|
12519
|
+
factory: ApplicationRef.ɵfac
|
|
12521
12520
|
});
|
|
12522
12521
|
}
|
|
12523
12522
|
(() => {
|
|
12524
12523
|
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationRef, [{
|
|
12525
|
-
type:
|
|
12526
|
-
args: [{
|
|
12527
|
-
providedIn: 'root'
|
|
12528
|
-
}]
|
|
12524
|
+
type: Service
|
|
12529
12525
|
}], () => [], null);
|
|
12530
12526
|
})();
|
|
12531
12527
|
function normalizeBootstrapOptions(hostElementOrOptions) {
|
|
@@ -12967,20 +12963,6 @@ function ɵɵdeferEnableTimerScheduling(tView, tDetails, placeholderConfigIndex,
|
|
|
12967
12963
|
}
|
|
12968
12964
|
}
|
|
12969
12965
|
|
|
12970
|
-
function promiseWithResolvers() {
|
|
12971
|
-
let resolve;
|
|
12972
|
-
let reject;
|
|
12973
|
-
const promise = new Promise((res, rej) => {
|
|
12974
|
-
resolve = res;
|
|
12975
|
-
reject = rej;
|
|
12976
|
-
});
|
|
12977
|
-
return {
|
|
12978
|
-
promise,
|
|
12979
|
-
resolve,
|
|
12980
|
-
reject
|
|
12981
|
-
};
|
|
12982
|
-
}
|
|
12983
|
-
|
|
12984
12966
|
function scheduleDelayedTrigger(scheduleFn) {
|
|
12985
12967
|
const lView = getLView();
|
|
12986
12968
|
const tNode = getCurrentTNode();
|
|
@@ -14943,15 +14925,18 @@ function setMaskBit(hasChange) {
|
|
|
14943
14925
|
changeMaskCounter++;
|
|
14944
14926
|
}
|
|
14945
14927
|
function applyI18n(tView, lView, index) {
|
|
14946
|
-
|
|
14947
|
-
|
|
14948
|
-
|
|
14949
|
-
|
|
14950
|
-
|
|
14951
|
-
|
|
14928
|
+
try {
|
|
14929
|
+
if (changeMaskCounter > 0) {
|
|
14930
|
+
ngDevMode && assertDefined(tView, `tView should be defined`);
|
|
14931
|
+
const tI18n = tView.data[index];
|
|
14932
|
+
const updateOpCodes = Array.isArray(tI18n) ? tI18n : tI18n.update;
|
|
14933
|
+
const bindingsStartIndex = getBindingIndex() - changeMaskCounter - 1;
|
|
14934
|
+
applyUpdateOpCodes(tView, lView, updateOpCodes, bindingsStartIndex, changeMask);
|
|
14935
|
+
}
|
|
14936
|
+
} finally {
|
|
14937
|
+
changeMask = 0b0;
|
|
14938
|
+
changeMaskCounter = 0;
|
|
14952
14939
|
}
|
|
14953
|
-
changeMask = 0b0;
|
|
14954
|
-
changeMaskCounter = 0;
|
|
14955
14940
|
}
|
|
14956
14941
|
function createNodeWithoutHydration(lView, textOrName, nodeType) {
|
|
14957
14942
|
const renderer = lView[RENDERER];
|
|
@@ -15503,7 +15488,7 @@ function i18nAttributesFirstPass(tView, index, values) {
|
|
|
15503
15488
|
if (ICU_REGEXP.test(message)) {
|
|
15504
15489
|
throw new Error(`ICU expressions are not supported in attributes. Message: "${message}".`);
|
|
15505
15490
|
}
|
|
15506
|
-
generateBindingUpdateOpCodes(updateOpCodes, message, previousElementIndex, attrName, countBindings(updateOpCodes),
|
|
15491
|
+
generateBindingUpdateOpCodes(updateOpCodes, message, previousElementIndex, attrName, countBindings(updateOpCodes), i18nSanitizeAttribute(attrName));
|
|
15507
15492
|
}
|
|
15508
15493
|
}
|
|
15509
15494
|
tView.data[index] = updateOpCodes;
|
|
@@ -15735,7 +15720,7 @@ function walkIcuTree(ast, tView, tIcu, lView, sharedUpdateOpCodes, create, remov
|
|
|
15735
15720
|
const hasBinding = !!attr.value.match(BINDING_REGEXP);
|
|
15736
15721
|
if (hasBinding) {
|
|
15737
15722
|
if (VALID_ATTRS.hasOwnProperty(lowerAttrName)) {
|
|
15738
|
-
generateBindingUpdateOpCodes(update, attr.value, newIndex, attr.name, 0,
|
|
15723
|
+
generateBindingUpdateOpCodes(update, attr.value, newIndex, attr.name, 0, i18nSanitizeAttribute(lowerAttrName));
|
|
15739
15724
|
} else {
|
|
15740
15725
|
ngDevMode && console.warn(`WARNING: ignoring unsafe attribute value ` + `${lowerAttrName} on element ${tagName} ` + `(see ${XSS_SECURITY_URL})`);
|
|
15741
15726
|
}
|
|
@@ -15818,6 +15803,17 @@ function addCreateNodeAndAppend(create, marker, text, appendToParentIdx, createA
|
|
|
15818
15803
|
function addCreateAttribute(create, newIndex, attrName, attrValue) {
|
|
15819
15804
|
create.push(newIndex << 1 | 1, attrName, attrValue);
|
|
15820
15805
|
}
|
|
15806
|
+
const SECURITY_SENSITIVE_ATTRS = /* @__PURE__ */(() => new Set(Object.values(SECURITY_SENSITIVE_ELEMENTS).flatMap(attrs => attrs ? Object.keys(attrs) : [])))();
|
|
15807
|
+
function i18nSanitizeAttribute(attrName) {
|
|
15808
|
+
const lowerAttrName = attrName.toLowerCase();
|
|
15809
|
+
if (SENSITIVE_ATTRS[lowerAttrName]) {
|
|
15810
|
+
return _sanitizeUrl;
|
|
15811
|
+
}
|
|
15812
|
+
if (SECURITY_SENSITIVE_ATTRS.has(lowerAttrName)) {
|
|
15813
|
+
return ɵɵvalidateAttribute;
|
|
15814
|
+
}
|
|
15815
|
+
return null;
|
|
15816
|
+
}
|
|
15821
15817
|
|
|
15822
15818
|
const ROOT_TEMPLATE_ID = 0;
|
|
15823
15819
|
const PP_MULTI_VALUE_PLACEHOLDERS_REGEXP = /\[(�.+?�?)\]/;
|
|
@@ -17189,6 +17185,31 @@ function maybeUnwrapModuleWithProviders(value) {
|
|
|
17189
17185
|
return isModuleWithProviders(value) ? value.ngModule : value;
|
|
17190
17186
|
}
|
|
17191
17187
|
|
|
17188
|
+
let _dehydratedBlockRegistryFactory = () => null;
|
|
17189
|
+
let _runIncrementalHydrationBootstrap = () => {};
|
|
17190
|
+
let isIncrementalHydrationRuntimeActive = false;
|
|
17191
|
+
function createDehydratedBlockRegistry() {
|
|
17192
|
+
return _dehydratedBlockRegistryFactory();
|
|
17193
|
+
}
|
|
17194
|
+
function runIncrementalHydrationBootstrap(injector, doc) {
|
|
17195
|
+
_runIncrementalHydrationBootstrap(injector, doc);
|
|
17196
|
+
}
|
|
17197
|
+
function ɵɵenableIncrementalHydrationRuntime() {
|
|
17198
|
+
if (isIncrementalHydrationRuntimeActive) {
|
|
17199
|
+
return;
|
|
17200
|
+
}
|
|
17201
|
+
isIncrementalHydrationRuntimeActive = true;
|
|
17202
|
+
enableRetrieveDeferBlockDataImpl();
|
|
17203
|
+
performanceMarkFeature('NgIncrementalHydration');
|
|
17204
|
+
_dehydratedBlockRegistryFactory = () => new DehydratedBlockRegistry();
|
|
17205
|
+
_runIncrementalHydrationBootstrap = (injector, doc) => {
|
|
17206
|
+
const deferBlockData = processBlockData(injector);
|
|
17207
|
+
const commentsByBlockId = gatherDeferBlocksCommentNodes(doc, doc.body);
|
|
17208
|
+
processAndInitTriggers(injector, deferBlockData, commentsByBlockId);
|
|
17209
|
+
appendDeferBlocksToJSActionMap(doc, injector);
|
|
17210
|
+
};
|
|
17211
|
+
}
|
|
17212
|
+
|
|
17192
17213
|
function ɵɵpureFunction0(slotOffset, pureFn) {
|
|
17193
17214
|
const bindingIndex = getBindingRoot() + slotOffset;
|
|
17194
17215
|
const lView = getLView();
|
|
@@ -17651,6 +17672,7 @@ const angularCoreEnv = (() => ({
|
|
|
17651
17672
|
'ɵɵdeferHydrateOnInteraction': ɵɵdeferHydrateOnInteraction,
|
|
17652
17673
|
'ɵɵdeferHydrateOnViewport': ɵɵdeferHydrateOnViewport,
|
|
17653
17674
|
'ɵɵdeferEnableTimerScheduling': ɵɵdeferEnableTimerScheduling,
|
|
17675
|
+
'ɵɵenableIncrementalHydrationRuntime': ɵɵenableIncrementalHydrationRuntime,
|
|
17654
17676
|
'ɵɵrepeater': ɵɵrepeater,
|
|
17655
17677
|
'ɵɵrepeaterCreate': ɵɵrepeaterCreate,
|
|
17656
17678
|
'ɵɵrepeaterTrackByIndex': ɵɵrepeaterTrackByIndex,
|
|
@@ -17879,12 +17901,12 @@ function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRo
|
|
|
17879
17901
|
verifySemanticsOfNgModuleImport(modOrStandaloneCmpt, moduleType);
|
|
17880
17902
|
verifySemanticsOfNgModuleDef(modOrStandaloneCmpt, false, moduleType);
|
|
17881
17903
|
});
|
|
17882
|
-
const exports
|
|
17904
|
+
const exports = maybeUnwrapFn(ngModuleDef.exports);
|
|
17883
17905
|
declarations.forEach(verifyDeclarationsHaveDefinitions);
|
|
17884
17906
|
declarations.forEach(verifyDirectivesHaveSelector);
|
|
17885
17907
|
declarations.forEach(declarationType => verifyNotStandalone(declarationType, moduleType));
|
|
17886
17908
|
const combinedDeclarations = [...declarations.map(resolveForwardRef), ...flatten(imports.map(computeCombinedExports)).map(resolveForwardRef)];
|
|
17887
|
-
exports
|
|
17909
|
+
exports.forEach(verifyExportsAreDeclaredOrReExported);
|
|
17888
17910
|
declarations.forEach(decl => verifyDeclarationIsUnique(decl, allowDuplicateDeclarationsInRoot));
|
|
17889
17911
|
const ngModule = getAnnotation(moduleType, 'NgModule');
|
|
17890
17912
|
if (ngModule) {
|
|
@@ -18294,6 +18316,7 @@ function directiveMetadata(type, metadata) {
|
|
|
18294
18316
|
const propMetadata = reflect.ownPropMetadata(type);
|
|
18295
18317
|
return {
|
|
18296
18318
|
name: type.name,
|
|
18319
|
+
legacyOptionalChaining: false,
|
|
18297
18320
|
type: type,
|
|
18298
18321
|
selector: metadata.selector !== undefined ? metadata.selector : null,
|
|
18299
18322
|
host: metadata.host || EMPTY_OBJ,
|
|
@@ -18345,7 +18368,8 @@ function convertToR3QueryMetadata(propertyName, ann) {
|
|
|
18345
18368
|
};
|
|
18346
18369
|
}
|
|
18347
18370
|
function extractQueriesMetadata(type, propMetadata, isQueryAnn) {
|
|
18348
|
-
const
|
|
18371
|
+
const signalQueriesMeta = [];
|
|
18372
|
+
const decoratorQueriesMeta = [];
|
|
18349
18373
|
for (const field in propMetadata) {
|
|
18350
18374
|
if (propMetadata.hasOwnProperty(field)) {
|
|
18351
18375
|
const annotations = propMetadata[field];
|
|
@@ -18357,12 +18381,17 @@ function extractQueriesMetadata(type, propMetadata, isQueryAnn) {
|
|
|
18357
18381
|
if (annotations.some(isInputAnnotation)) {
|
|
18358
18382
|
throw new Error(`Cannot combine @Input decorators with query decorators`);
|
|
18359
18383
|
}
|
|
18360
|
-
|
|
18384
|
+
const queryMeta = convertToR3QueryMetadata(field, ann);
|
|
18385
|
+
if (queryMeta.isSignal) {
|
|
18386
|
+
signalQueriesMeta.push(queryMeta);
|
|
18387
|
+
} else {
|
|
18388
|
+
decoratorQueriesMeta.push(queryMeta);
|
|
18389
|
+
}
|
|
18361
18390
|
}
|
|
18362
18391
|
});
|
|
18363
18392
|
}
|
|
18364
18393
|
}
|
|
18365
|
-
return
|
|
18394
|
+
return [...signalQueriesMeta, ...decoratorQueriesMeta];
|
|
18366
18395
|
}
|
|
18367
18396
|
function extractExportAs(exportAs) {
|
|
18368
18397
|
return exportAs === undefined ? null : splitByComma(exportAs);
|
|
@@ -18669,18 +18698,14 @@ class ChangeDetectionSchedulerImpl {
|
|
|
18669
18698
|
static ɵfac = function ChangeDetectionSchedulerImpl_Factory(__ngFactoryType__) {
|
|
18670
18699
|
return new (__ngFactoryType__ || ChangeDetectionSchedulerImpl)();
|
|
18671
18700
|
};
|
|
18672
|
-
static ɵprov = /*@__PURE__
|
|
18701
|
+
static ɵprov = /*@__PURE__*/ɵɵdefineService({
|
|
18673
18702
|
token: ChangeDetectionSchedulerImpl,
|
|
18674
|
-
factory: ChangeDetectionSchedulerImpl.ɵfac
|
|
18675
|
-
providedIn: 'root'
|
|
18703
|
+
factory: ChangeDetectionSchedulerImpl.ɵfac
|
|
18676
18704
|
});
|
|
18677
18705
|
}
|
|
18678
18706
|
(() => {
|
|
18679
18707
|
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ChangeDetectionSchedulerImpl, [{
|
|
18680
|
-
type:
|
|
18681
|
-
args: [{
|
|
18682
|
-
providedIn: 'root'
|
|
18683
|
-
}]
|
|
18708
|
+
type: Service
|
|
18684
18709
|
}], () => [], null);
|
|
18685
18710
|
})();
|
|
18686
18711
|
function provideZonelessChangeDetection() {
|
|
@@ -18722,18 +18747,14 @@ class Compiler {
|
|
|
18722
18747
|
static ɵfac = function Compiler_Factory(__ngFactoryType__) {
|
|
18723
18748
|
return new (__ngFactoryType__ || Compiler)();
|
|
18724
18749
|
};
|
|
18725
|
-
static ɵprov = /*@__PURE__
|
|
18750
|
+
static ɵprov = /*@__PURE__*/ɵɵdefineService({
|
|
18726
18751
|
token: Compiler,
|
|
18727
|
-
factory: Compiler.ɵfac
|
|
18728
|
-
providedIn: 'root'
|
|
18752
|
+
factory: Compiler.ɵfac
|
|
18729
18753
|
});
|
|
18730
18754
|
}
|
|
18731
18755
|
(() => {
|
|
18732
18756
|
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Compiler, [{
|
|
18733
|
-
type:
|
|
18734
|
-
args: [{
|
|
18735
|
-
providedIn: 'root'
|
|
18736
|
-
}]
|
|
18757
|
+
type: Service
|
|
18737
18758
|
}], null, null);
|
|
18738
18759
|
})();
|
|
18739
18760
|
const COMPILER_OPTIONS = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'compilerOptions' : '');
|
|
@@ -19111,5 +19132,5 @@ function getDebugNode(nativeNode) {
|
|
|
19111
19132
|
return null;
|
|
19112
19133
|
}
|
|
19113
19134
|
|
|
19114
|
-
export { AFTER_RENDER_PHASES, ANIMATIONS_DISABLED,
|
|
19135
|
+
export { AFTER_RENDER_PHASES, ANIMATIONS_DISABLED, APP_BOOTSTRAP_LISTENER, APP_INITIALIZER, AcxChangeDetectionStrategy, AcxViewEncapsulation, AfterRenderImpl, AfterRenderManager, AfterRenderSequence, ApplicationInitStatus, ApplicationRef, Attribute, COMPILER_OPTIONS, CONTAINERS, CUSTOM_ELEMENTS_SCHEMA, ChainedInjector, ChangeDetectionSchedulerImpl, ChangeDetectionStrategy, Compiler, CompilerFactory, Component, ComponentFactory, ComponentRef$1 as ComponentRef, ComponentRef as ComponentRef$1, Console, ControlFlowBlockType, DEFAULT_CURRENCY_CODE, DEFAULT_LOCALE_ID, DEFER_BLOCK_CONFIG, DEFER_BLOCK_DEPENDENCY_INTERCEPTOR, DEFER_BLOCK_ID, DEFER_BLOCK_SSR_ID_ATTRIBUTE, DEFER_BLOCK_STATE$1 as DEFER_BLOCK_STATE, DEFER_BLOCK_STATE as DEFER_BLOCK_STATE$1, DEFER_HYDRATE_TRIGGERS, DEFER_PARENT_BLOCK_ID, DEHYDRATED_BLOCK_REGISTRY, DISCONNECTED_NODES, DebugElement, DebugEventListener, DebugNode, DeferBlockBehavior, DeferBlockState, Directive, ELEMENT_CONTAINERS, EVENT_REPLAY_ENABLED_DEFAULT, EVENT_REPLAY_QUEUE, ElementRef, EnvironmentNgModuleRefAdapter, Host, HostBinding, HostListener, HydrationStatus, I18N_DATA, IDLE_SERVICE, IS_ENABLED_BLOCKING_INITIAL_NAVIGATION, IS_EVENT_REPLAY_ENABLED, IS_HYDRATION_DOM_REUSE_ENABLED, IS_I18N_HYDRATION_ENABLED, IS_INCREMENTAL_HYDRATION_ENABLED, Inject, Injectable, Input, JSACTION_BLOCK_ELEMENT_MAP, JSACTION_EVENT_CONTRACT, LContext, LOCALE_ID, LocaleDataIndex, MAX_ANIMATION_TIMEOUT, MULTIPLIER, MissingTranslationStrategy, NGH_ATTR_NAME, NGH_DATA_KEY, NGH_DEFER_BLOCKS_KEY, NODES, NOOP_AFTER_RENDER_REF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE, NO_ERRORS_SCHEMA, NUM_ROOT_NODES, NgModule, NgModuleFactory, NgModuleFactory$1, NgModuleRef, NgModuleRef$1, NodeInjector, Optional, Output, PRESERVE_HOST_CONTENT, Pipe, ProfilerEvent, QueryList, ReflectionCapabilities, Renderer2, RendererFactory2, RendererStyleFlags2, SHARED_STYLES_HOST, SKIP_HYDRATION_ATTR_NAME, SSR_CONTENT_INTEGRITY_MARKER, Sanitizer, SecurityContext, Self, Service, SimpleChange, SkipSelf, TEMPLATES, TEMPLATE_ID, TESTABILITY, TESTABILITY_GETTER, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, TimerScheduler, TracingAction, TracingService, Type, USE_PENDING_TASKS, UseExhaustiveCheckNoChanges, ViewContainerRef, ViewEncapsulation, ViewRef, _sanitizeHtml, _sanitizeUrl, afterEveryRender, afterNextRender, allLeavingAnimations, allowSanitizationBypassAndThrow, angularCoreEnv, asNativeElements, assertComponentDef, assertStandaloneComponentType, bypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript, bypassSanitizationTrustStyle, bypassSanitizationTrustUrl, calcPathForNode, checkNoChangesInternal, cleanupDehydratedViews, clearResolutionOfComponentResourcesQueue, collectNativeNodes, collectNativeNodesInLContainer, compileComponent, compileDirective, compileNgModule, compileNgModuleDefs, compilePipe, convertHydrateTriggersToJsAction, countBlocksSkippedByHydration, createDehydratedBlockRegistry, createEnvironmentInjector, createMultiResultQuerySignalFn, createNgModule, createNgModuleRefWithProviders, createSingleResultOptionalQuerySignalFn, createSingleResultRequiredQuerySignalFn, depsTracker, devModeEqual, enableApplyRootElementTransformImpl, enableClaimDehydratedIcuCaseImpl, enableFindMatchingDehydratedViewImpl, enableLocateOrCreateContainerAnchorImpl, enableLocateOrCreateContainerRefImpl, enableLocateOrCreateElementContainerNodeImpl, enableLocateOrCreateElementNodeImpl, enableLocateOrCreateI18nNodeImpl, enableLocateOrCreateTextNodeImpl, enablePrepareI18nBlockForHydrationImpl, enableProfiling, enableRetrieveHydrationInfoImpl, enableStashEventListenerImpl, findLocaleData, flushModuleScopingQueueAsMuchAsPossible, generateStandaloneInDeclarationsError, getAsyncClassMetadataFn, getClosestComponentName, getCompilerFacade, getDebugNode, getDeferBlocks, getDirectives, getDocument, getHostElement, getInjector, getInjectorMetadata, getInjectorProviders, getLContext, getLDeferBlockDetails, getLNodeForHydration, getLocaleCurrencyCode, getLocalePluralCase, getNodeInjectorTNode, getOrComputeI18nChildren, getRegisteredNgModuleType, getSanitizationBypassType, getSignalGraph, getTDeferBlockDetails, getTransferState, inferTagNameFromDefinition, inputBinding, invokeListeners, isComponentDefPendingResolution, isComponentResourceResolutionQueueEmpty, isDeferBlock, isDetachedByI18n, isDisconnectedNode, isI18nHydrationEnabled, isI18nHydrationSupportEnabled, isInSkipHydrationBlock, isIncrementalHydrationEnabled, isJsObject, isLetDeclaration, isListLikeIterable, isNgModule, isPromise, isSubscribable, isTNodeShape, isViewDirty, iterateListLike, makePropDecorator, markForRefresh, noSideEffects, optionsReducer, outputBinding, patchComponentDefWithScope, performanceMarkFeature, processTextNodeBeforeSerialization, profiler, promiseWithResolvers, provideAppInitializer, provideIdleServiceWith, provideNgReflectAttributes, provideZonelessChangeDetection, provideZonelessChangeDetectionInternal, publishDefaultGlobalUtils, publishExternalGlobalUtil, publishSignalConfiguration, readHydrationInfo, registerLocaleData, registerNgModuleType, remove, removeListeners, renderDeferBlockState, resetCompiledComponents, resetIncrementalHydrationEnabledWarnedForTests, resetJitOptions, resolveComponentResources, restoreComponentResolutionQueue, runIncrementalHydrationBootstrap, setAllowDuplicateNgModuleIdsForTest, setClassMetadata, setClassMetadataAsync, setDocument, setIsI18nHydrationSupportEnabled, setJSActionAttributes, setJitOptions, setLocaleId, setStashFn, setTestabilityGetter, sharedMapFunction, sharedStashFunction, transitiveScopesFor, triggerHydrationFromBlockName, triggerResourceLoading, trySerializeI18nBlock, twoWayBinding, unregisterAllLocaleData, unsupportedProjectionOfDomNodes, unwrapSafeValue, validateMatchingNode, validateNodeExists, verifySsrContentsIntegrity, walkLViewDirectives, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, ɵsetClassDebugInfo, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, ɵɵControlFeature, ɵɵExternalStylesFeature, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵadvance, ɵɵanimateEnter, ɵɵanimateEnterListener, ɵɵanimateLeave, ɵɵanimateLeaveListener, ɵɵariaProperty, ɵɵarrowFunction, ɵɵattachSourceLocations, ɵɵattribute, ɵɵclassMap, ɵɵclassProp, ɵɵcomponentInstance, ɵɵconditional, ɵɵconditionalBranchCreate, ɵɵconditionalCreate, ɵɵcontentQuery, ɵɵcontentQuerySignal, ɵɵcontrol, ɵɵcontrolCreate, ɵɵdeclareLet, ɵɵdefer, ɵɵdeferEnableTimerScheduling, ɵɵdeferHydrateNever, ɵɵdeferHydrateOnHover, ɵɵdeferHydrateOnIdle, ɵɵdeferHydrateOnImmediate, ɵɵdeferHydrateOnInteraction, ɵɵdeferHydrateOnTimer, ɵɵdeferHydrateOnViewport, ɵɵdeferHydrateWhen, ɵɵdeferOnHover, ɵɵdeferOnIdle, ɵɵdeferOnImmediate, ɵɵdeferOnInteraction, ɵɵdeferOnTimer, ɵɵdeferOnViewport, ɵɵdeferPrefetchOnHover, ɵɵdeferPrefetchOnIdle, ɵɵdeferPrefetchOnImmediate, ɵɵdeferPrefetchOnInteraction, ɵɵdeferPrefetchOnTimer, ɵɵdeferPrefetchOnViewport, ɵɵdeferPrefetchWhen, ɵɵdeferWhen, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdefineService, ɵɵdirectiveInject, ɵɵdomElement, ɵɵdomElementContainer, ɵɵdomElementContainerEnd, ɵɵdomElementContainerStart, ɵɵdomElementEnd, ɵɵdomElementStart, ɵɵdomListener, ɵɵdomProperty, ɵɵdomTemplate, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableIncrementalHydrationRuntime, ɵɵgetComponentDepsFactory, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵgetReplaceMetadataURL, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinjectAttribute, ɵɵinterpolate, ɵɵinterpolate1, ɵɵinterpolate2, ɵɵinterpolate3, ɵɵinterpolate4, ɵɵinterpolate5, ɵɵinterpolate6, ɵɵinterpolate7, ɵɵinterpolate8, ɵɵinterpolateV, ɵɵinvalidFactory, ɵɵlistener, ɵɵloadQuery, ɵɵnextContext, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryAdvance, ɵɵqueryRefresh, ɵɵreadContextLet, ɵɵreference, ɵɵrepeater, ɵɵrepeaterCreate, ɵɵrepeaterTrackByIdentity, ɵɵrepeaterTrackByIndex, ɵɵreplaceMetadata, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstoreLet, ɵɵstyleMap, ɵɵstyleProp, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵtwoWayBindingSet, ɵɵtwoWayListener, ɵɵtwoWayProperty, ɵɵvalidateAttribute, ɵɵviewQuery, ɵɵviewQuerySignal };
|
|
19115
19136
|
//# sourceMappingURL=_debug_node-chunk.mjs.map
|