@angular/core 19.2.4 → 19.2.6
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/{event_dispatcher.d-pVP0-wST.d.ts → event_dispatcher.d-DlbccpYq.d.ts} +3 -2
- package/fesm2022/core.mjs +103 -88
- 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 +3 -3
- package/fesm2022/rxjs-interop.mjs +4 -3
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/testing.mjs +148 -97
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/{untracked-CS7WUAzb.mjs → untracked-BKcld_ew.mjs} +3 -3
- package/fesm2022/{untracked-CS7WUAzb.mjs.map → untracked-BKcld_ew.mjs.map} +1 -1
- package/index.d.ts +23 -7
- package/{navigation_types.d-DgDrF5rp.d.ts → navigation_types.d-fAxd92YV.d.ts} +3 -2
- package/package.json +1 -1
- package/primitives/di/index.d.ts +3 -2
- package/primitives/event-dispatch/index.d.ts +3 -3
- package/primitives/signals/index.d.ts +5 -4
- package/rxjs-interop/index.d.ts +4 -3
- package/schematics/bundles/{apply_import_manager-BynuozbO.js → apply_import_manager-DFADpdFu.js} +3 -3
- package/schematics/bundles/{checker-DP-zos5Q.js → checker-DoX_7XCa.js} +20 -13
- package/schematics/bundles/cleanup-unused-imports.js +42 -64
- package/schematics/bundles/{compiler_host-DzM2hemp.js → compiler_host-BUKEE1cA.js} +2 -2
- package/schematics/bundles/control-flow-migration.js +3 -3
- package/schematics/bundles/explicit-standalone-flag.js +3 -3
- package/schematics/bundles/imports-CIX-JgAN.js +1 -1
- package/schematics/bundles/{program-BmLi-Vxz.js → index-B4b0V0Vo.js} +52 -26
- package/schematics/bundles/{index-CPpyW--c.js → index-CpZKzrqM.js} +6 -6
- package/schematics/bundles/inject-migration.js +25 -8
- package/schematics/bundles/leading_space-D9nQ8UQC.js +1 -1
- package/schematics/bundles/{migrate_ts_type_references-Ri-K4P_1.js → migrate_ts_type_references-DQVDid4G.js} +5 -5
- package/schematics/bundles/ng_decorators-DznZ5jMl.js +1 -1
- package/schematics/bundles/nodes-B16H9JUd.js +1 -1
- package/schematics/bundles/output-migration.js +115 -81
- package/schematics/bundles/pending-tasks.js +3 -3
- package/schematics/bundles/{project_paths-CXXqWSoY.js → project_paths-C3etOlgT.js} +88 -13
- package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.js +1 -1
- package/schematics/bundles/property_name-BBwFuqMe.js +1 -1
- package/schematics/bundles/provide-initializer.js +3 -3
- package/schematics/bundles/route-lazy-loading.js +3 -3
- package/schematics/bundles/self-closing-tags-migration.js +39 -64
- package/schematics/bundles/signal-input-migration.js +64 -87
- package/schematics/bundles/signal-queries-migration.js +82 -93
- package/schematics/bundles/signals.js +11 -11
- package/schematics/bundles/standalone-migration.js +5 -6
- package/testing/index.d.ts +7 -22
- package/{weak_ref.d-Bp6cSy-X.d.ts → weak_ref.d-DWHPG08n.d.ts} +3 -2
- package/schematics/bundles/index-BPqwMr5d.js +0 -30
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v19.2.
|
|
2
|
+
* @license Angular v19.2.6
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -342,4 +342,5 @@ declare class EventDispatcher {
|
|
|
342
342
|
*/
|
|
343
343
|
declare function registerDispatcher(eventContract: UnrenamedEventContract, dispatcher: EventDispatcher): void;
|
|
344
344
|
|
|
345
|
-
export {
|
|
345
|
+
export { EventContract, EventContractContainer, EventDispatcher, EventInfoWrapper, EventPhase, Restriction, registerDispatcher };
|
|
346
|
+
export type { EarlyJsactionDataContainer, EventInfo };
|
package/fesm2022/core.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v19.2.
|
|
2
|
+
* @license Angular v19.2.6
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
export {
|
|
7
|
+
import { SIGNAL_NODE, signalSetFn, SIGNAL, producerAccessed, getActiveConsumer, setActiveConsumer as setActiveConsumer$1, createSignal, signalUpdateFn, consumerDestroy, REACTIVE_NODE, consumerPollProducersForChange, consumerBeforeComputation, consumerAfterComputation, createComputed, setThrowInvalidWriteToSignalError, untracked as untracked$1, isInNotificationPhase, createLinkedSignal, linkedSignalSetFn, linkedSignalUpdateFn } from './untracked-BKcld_ew.mjs';
|
|
8
|
+
export { setAlternateWeakRefImpl as ɵsetAlternateWeakRefImpl } from './untracked-BKcld_ew.mjs';
|
|
9
9
|
import { getCurrentInjector, NOT_FOUND as NOT_FOUND$1, setCurrentInjector } from './primitives/di.mjs';
|
|
10
10
|
import { setActiveConsumer, createWatch } from '@angular/core/primitives/signals';
|
|
11
11
|
import { NOT_FOUND as NOT_FOUND$2 } from '@angular/core/primitives/di';
|
|
@@ -49,15 +49,18 @@ class RuntimeError extends Error {
|
|
|
49
49
|
this.code = code;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
+
function formatRuntimeErrorCode(code) {
|
|
53
|
+
// Error code might be a negative number, which is a special marker that instructs the logic to
|
|
54
|
+
// generate a link to the error details page on angular.io.
|
|
55
|
+
// We also prepend `0` to non-compile-time errors.
|
|
56
|
+
return `NG0${Math.abs(code)}`;
|
|
57
|
+
}
|
|
52
58
|
/**
|
|
53
59
|
* Called to format a runtime error.
|
|
54
60
|
* See additional info on the `message` argument type in the `RuntimeError` class description.
|
|
55
61
|
*/
|
|
56
62
|
function formatRuntimeError(code, message) {
|
|
57
|
-
|
|
58
|
-
// generate a link to the error details page on angular.io.
|
|
59
|
-
// We also prepend `0` to non-compile-time errors.
|
|
60
|
-
const fullCode = `NG0${Math.abs(code)}`;
|
|
63
|
+
const fullCode = formatRuntimeErrorCode(code);
|
|
61
64
|
let errorMessage = `${fullCode}${message ? ': ' + message : ''}`;
|
|
62
65
|
if (ngDevMode && code < 0) {
|
|
63
66
|
const addPeriodSeparator = !errorMessage.match(/[.,;!?\n]$/);
|
|
@@ -4716,52 +4719,6 @@ function mergeHostAttribute(dst, marker, key1, key2, value) {
|
|
|
4716
4719
|
}
|
|
4717
4720
|
}
|
|
4718
4721
|
|
|
4719
|
-
// This default value is when checking the hierarchy for a token.
|
|
4720
|
-
//
|
|
4721
|
-
// It means both:
|
|
4722
|
-
// - the token is not provided by the current injector,
|
|
4723
|
-
// - only the element injectors should be checked (ie do not check module injectors
|
|
4724
|
-
//
|
|
4725
|
-
// mod1
|
|
4726
|
-
// /
|
|
4727
|
-
// el1 mod2
|
|
4728
|
-
// \ /
|
|
4729
|
-
// el2
|
|
4730
|
-
//
|
|
4731
|
-
// When requesting el2.injector.get(token), we should check in the following order and return the
|
|
4732
|
-
// first found value:
|
|
4733
|
-
// - el2.injector.get(token, default)
|
|
4734
|
-
// - el1.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) -> do not check the module
|
|
4735
|
-
// - mod2.injector.get(token, default)
|
|
4736
|
-
const NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};
|
|
4737
|
-
|
|
4738
|
-
/**
|
|
4739
|
-
* Injector that looks up a value using a specific injector, before falling back to the module
|
|
4740
|
-
* injector. Used primarily when creating components or embedded views dynamically.
|
|
4741
|
-
*/
|
|
4742
|
-
class ChainedInjector {
|
|
4743
|
-
injector;
|
|
4744
|
-
parentInjector;
|
|
4745
|
-
constructor(injector, parentInjector) {
|
|
4746
|
-
this.injector = injector;
|
|
4747
|
-
this.parentInjector = parentInjector;
|
|
4748
|
-
}
|
|
4749
|
-
get(token, notFoundValue, flags) {
|
|
4750
|
-
flags = convertToBitFlags(flags);
|
|
4751
|
-
const value = this.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, flags);
|
|
4752
|
-
if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||
|
|
4753
|
-
notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
|
|
4754
|
-
// Return the value from the root element injector when
|
|
4755
|
-
// - it provides it
|
|
4756
|
-
// (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
|
|
4757
|
-
// - the module injector should not be checked
|
|
4758
|
-
// (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
|
|
4759
|
-
return value;
|
|
4760
|
-
}
|
|
4761
|
-
return this.parentInjector.get(token, notFoundValue, flags);
|
|
4762
|
-
}
|
|
4763
|
-
}
|
|
4764
|
-
|
|
4765
4722
|
/// Parent Injector Utils ///////////////////////////////////////////////////////////////
|
|
4766
4723
|
function hasParentInjector(parentLocation) {
|
|
4767
4724
|
return parentLocation !== NO_PARENT_INJECTOR;
|
|
@@ -4800,14 +4757,6 @@ function getParentInjectorView(location, startView) {
|
|
|
4800
4757
|
}
|
|
4801
4758
|
return parentView;
|
|
4802
4759
|
}
|
|
4803
|
-
/**
|
|
4804
|
-
* Detects whether an injector is an instance of a `ChainedInjector`,
|
|
4805
|
-
* created based on the `OutletInjector`.
|
|
4806
|
-
*/
|
|
4807
|
-
function isRouterOutletInjector(currentInjector) {
|
|
4808
|
-
return (currentInjector instanceof ChainedInjector &&
|
|
4809
|
-
typeof currentInjector.injector.__ngOutletInjector === 'function');
|
|
4810
|
-
}
|
|
4811
4760
|
|
|
4812
4761
|
/**
|
|
4813
4762
|
* Defines if the call to `inject` should include `viewProviders` in its resolution.
|
|
@@ -8523,7 +8472,7 @@ var AfterRenderPhase;
|
|
|
8523
8472
|
* Use `AfterRenderPhase.EarlyRead` for callbacks that only need to **read** from the
|
|
8524
8473
|
* DOM before a subsequent `AfterRenderPhase.Write` callback, for example to perform
|
|
8525
8474
|
* custom layout that the browser doesn't natively support. Prefer the
|
|
8526
|
-
* `AfterRenderPhase.
|
|
8475
|
+
* `AfterRenderPhase.Read` phase if reading can wait until after the write phase.
|
|
8527
8476
|
* **Never** write to the DOM in this phase.
|
|
8528
8477
|
*
|
|
8529
8478
|
* <div class="docs-alert docs-alert-important">
|
|
@@ -9891,10 +9840,10 @@ function getParentBlockHydrationQueue(deferBlockId, injector) {
|
|
|
9891
9840
|
function gatherDeferBlocksByJSActionAttribute(doc) {
|
|
9892
9841
|
const jsactionNodes = doc.body.querySelectorAll('[jsaction]');
|
|
9893
9842
|
const blockMap = new Set();
|
|
9843
|
+
const eventTypes = [hoverEventNames.join(':;'), interactionEventNames.join(':;')].join('|');
|
|
9894
9844
|
for (let node of jsactionNodes) {
|
|
9895
9845
|
const attr = node.getAttribute('jsaction');
|
|
9896
9846
|
const blockId = node.getAttribute('ngb');
|
|
9897
|
-
const eventTypes = [...hoverEventNames.join(':;'), ...interactionEventNames.join(':;')].join('|');
|
|
9898
9847
|
if (attr?.match(eventTypes) && blockId !== null) {
|
|
9899
9848
|
blockMap.add(node);
|
|
9900
9849
|
}
|
|
@@ -9903,8 +9852,8 @@ function gatherDeferBlocksByJSActionAttribute(doc) {
|
|
|
9903
9852
|
}
|
|
9904
9853
|
function appendDeferBlocksToJSActionMap(doc, injector) {
|
|
9905
9854
|
const blockMap = gatherDeferBlocksByJSActionAttribute(doc);
|
|
9855
|
+
const jsActionMap = injector.get(JSACTION_BLOCK_ELEMENT_MAP);
|
|
9906
9856
|
for (let rNode of blockMap) {
|
|
9907
|
-
const jsActionMap = injector.get(JSACTION_BLOCK_ELEMENT_MAP);
|
|
9908
9857
|
sharedMapFunction(rNode, jsActionMap);
|
|
9909
9858
|
}
|
|
9910
9859
|
}
|
|
@@ -17244,6 +17193,52 @@ function addSet(sourceSet, targetSet) {
|
|
|
17244
17193
|
/** The deps tracker to be used in the current Angular app in dev mode. */
|
|
17245
17194
|
const depsTracker = new DepsTracker();
|
|
17246
17195
|
|
|
17196
|
+
// This default value is when checking the hierarchy for a token.
|
|
17197
|
+
//
|
|
17198
|
+
// It means both:
|
|
17199
|
+
// - the token is not provided by the current injector,
|
|
17200
|
+
// - only the element injectors should be checked (ie do not check module injectors
|
|
17201
|
+
//
|
|
17202
|
+
// mod1
|
|
17203
|
+
// /
|
|
17204
|
+
// el1 mod2
|
|
17205
|
+
// \ /
|
|
17206
|
+
// el2
|
|
17207
|
+
//
|
|
17208
|
+
// When requesting el2.injector.get(token), we should check in the following order and return the
|
|
17209
|
+
// first found value:
|
|
17210
|
+
// - el2.injector.get(token, default)
|
|
17211
|
+
// - el1.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) -> do not check the module
|
|
17212
|
+
// - mod2.injector.get(token, default)
|
|
17213
|
+
const NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};
|
|
17214
|
+
|
|
17215
|
+
/**
|
|
17216
|
+
* Injector that looks up a value using a specific injector, before falling back to the module
|
|
17217
|
+
* injector. Used primarily when creating components or embedded views dynamically.
|
|
17218
|
+
*/
|
|
17219
|
+
class ChainedInjector {
|
|
17220
|
+
injector;
|
|
17221
|
+
parentInjector;
|
|
17222
|
+
constructor(injector, parentInjector) {
|
|
17223
|
+
this.injector = injector;
|
|
17224
|
+
this.parentInjector = parentInjector;
|
|
17225
|
+
}
|
|
17226
|
+
get(token, notFoundValue, flags) {
|
|
17227
|
+
flags = convertToBitFlags(flags);
|
|
17228
|
+
const value = this.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, flags);
|
|
17229
|
+
if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||
|
|
17230
|
+
notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
|
|
17231
|
+
// Return the value from the root element injector when
|
|
17232
|
+
// - it provides it
|
|
17233
|
+
// (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
|
|
17234
|
+
// - the module injector should not be checked
|
|
17235
|
+
// (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
|
|
17236
|
+
return value;
|
|
17237
|
+
}
|
|
17238
|
+
return this.parentInjector.get(token, notFoundValue, flags);
|
|
17239
|
+
}
|
|
17240
|
+
}
|
|
17241
|
+
|
|
17247
17242
|
/**
|
|
17248
17243
|
* Compute the static styling (class/style) from `TAttributes`.
|
|
17249
17244
|
*
|
|
@@ -17916,7 +17911,7 @@ class ComponentFactory extends ComponentFactory$1 {
|
|
|
17916
17911
|
const cmpDef = this.componentDef;
|
|
17917
17912
|
ngDevMode && verifyNotAnOrphanComponent(cmpDef);
|
|
17918
17913
|
const tAttributes = rootSelectorOrNode
|
|
17919
|
-
? ['ng-version', '19.2.
|
|
17914
|
+
? ['ng-version', '19.2.6']
|
|
17920
17915
|
: // Extract attributes and classes from the first selector only to match VE behavior.
|
|
17921
17916
|
extractAttrsAndClassesFromSelector(this.componentDef.selectors[0]);
|
|
17922
17917
|
// Create the root view. Uses empty TView and ContentTemplate.
|
|
@@ -22359,16 +22354,7 @@ function getInjectorResolutionPathHelper(injector, resolutionPath) {
|
|
|
22359
22354
|
*/
|
|
22360
22355
|
function getInjectorParent(injector) {
|
|
22361
22356
|
if (injector instanceof R3Injector) {
|
|
22362
|
-
|
|
22363
|
-
if (isRouterOutletInjector(parent)) {
|
|
22364
|
-
// This is a special case for a `ChainedInjector` instance, which represents
|
|
22365
|
-
// a combination of a Router's `OutletInjector` and an EnvironmentInjector,
|
|
22366
|
-
// which represents a `@defer` block. Since the `OutletInjector` doesn't store
|
|
22367
|
-
// any tokens itself, we point to the parent injector instead. See the
|
|
22368
|
-
// `OutletInjector.__ngOutletInjector` field for additional information.
|
|
22369
|
-
return parent.parentInjector;
|
|
22370
|
-
}
|
|
22371
|
-
return parent;
|
|
22357
|
+
return injector.parent;
|
|
22372
22358
|
}
|
|
22373
22359
|
let tNode;
|
|
22374
22360
|
let lView;
|
|
@@ -23476,6 +23462,9 @@ class ApplicationRef {
|
|
|
23476
23462
|
* {@example core/ts/platform/platform.ts region='domNode'}
|
|
23477
23463
|
*/
|
|
23478
23464
|
bootstrap(componentOrFactory, rootSelectorOrNode) {
|
|
23465
|
+
return this.bootstrapImpl(componentOrFactory, rootSelectorOrNode);
|
|
23466
|
+
}
|
|
23467
|
+
bootstrapImpl(componentOrFactory, rootSelectorOrNode, injector = Injector.NULL) {
|
|
23479
23468
|
profiler(10 /* ProfilerEvent.BootstrapComponentStart */);
|
|
23480
23469
|
(typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed);
|
|
23481
23470
|
const isComponentFactory = componentOrFactory instanceof ComponentFactory$1;
|
|
@@ -23506,7 +23495,7 @@ class ApplicationRef {
|
|
|
23506
23495
|
? undefined
|
|
23507
23496
|
: this._injector.get(NgModuleRef$1);
|
|
23508
23497
|
const selectorOrNode = rootSelectorOrNode || componentFactory.selector;
|
|
23509
|
-
const compRef = componentFactory.create(
|
|
23498
|
+
const compRef = componentFactory.create(injector, [], selectorOrNode, ngModule);
|
|
23510
23499
|
const nativeElement = compRef.location.nativeElement;
|
|
23511
23500
|
const testability = compRef.injector.get(TESTABILITY, null);
|
|
23512
23501
|
testability?.registerApplication(nativeElement);
|
|
@@ -24313,6 +24302,25 @@ function setImmediateTriggers(injector, elementTriggers) {
|
|
|
24313
24302
|
}
|
|
24314
24303
|
}
|
|
24315
24304
|
|
|
24305
|
+
/**
|
|
24306
|
+
* Indicates whether we've already produced a warning,
|
|
24307
|
+
* prevents the logic from producing it multiple times.
|
|
24308
|
+
*/
|
|
24309
|
+
let _hmrWarningProduced = false;
|
|
24310
|
+
/**
|
|
24311
|
+
* Logs a message into the console to indicate that `@defer` block
|
|
24312
|
+
* dependencies are loaded eagerly when the HMR mode is enabled.
|
|
24313
|
+
*/
|
|
24314
|
+
function logHmrWarning(injector) {
|
|
24315
|
+
if (!_hmrWarningProduced) {
|
|
24316
|
+
_hmrWarningProduced = true;
|
|
24317
|
+
const console = injector.get(Console);
|
|
24318
|
+
// tslint:disable-next-line:no-console
|
|
24319
|
+
console.log(formatRuntimeError(-751 /* RuntimeErrorCode.DEFER_IN_HMR_MODE */, 'Angular has detected that this application contains `@defer` blocks ' +
|
|
24320
|
+
'and the hot module replacement (HMR) mode is enabled. All `@defer` ' +
|
|
24321
|
+
'block dependencies will be loaded eagerly.'));
|
|
24322
|
+
}
|
|
24323
|
+
}
|
|
24316
24324
|
/**
|
|
24317
24325
|
* Creates runtime data structures for defer blocks.
|
|
24318
24326
|
*
|
|
@@ -24342,6 +24350,9 @@ function ɵɵdefer(index, primaryTmplIndex, dependencyResolverFn, loadingTmplInd
|
|
|
24342
24350
|
const injector = lView[INJECTOR];
|
|
24343
24351
|
if (tView.firstCreatePass) {
|
|
24344
24352
|
performanceMarkFeature('NgDefer');
|
|
24353
|
+
if (ngDevMode && typeof ngHmrMode !== 'undefined' && ngHmrMode) {
|
|
24354
|
+
logHmrWarning(injector);
|
|
24355
|
+
}
|
|
24345
24356
|
const tDetails = {
|
|
24346
24357
|
primaryTmplIndex,
|
|
24347
24358
|
loadingTmplIndex: loadingTmplIndex ?? null,
|
|
@@ -26592,7 +26603,7 @@ function toStylingKeyValueArray(keyValueArraySet, stringParser, value) {
|
|
|
26592
26603
|
}
|
|
26593
26604
|
else {
|
|
26594
26605
|
ngDevMode &&
|
|
26595
|
-
throwError('Unsupported styling type ' + typeof unwrappedValue + '
|
|
26606
|
+
throwError('Unsupported styling type: ' + typeof unwrappedValue + ' (' + unwrappedValue + ')');
|
|
26596
26607
|
}
|
|
26597
26608
|
return styleKeyValueArray;
|
|
26598
26609
|
}
|
|
@@ -30017,7 +30028,7 @@ function ɵɵi18nPostprocess(message, replacements = {}) {
|
|
|
30017
30028
|
* @param wrapWithPreventDefault Whether or not to prevent default behavior
|
|
30018
30029
|
* (the procedural renderer does this already, so in those cases, we should skip)
|
|
30019
30030
|
*/
|
|
30020
|
-
function wrapListener(tNode, lView,
|
|
30031
|
+
function wrapListener(tNode, lView, listenerFn) {
|
|
30021
30032
|
// Note: we are performing most of the work in the listener function itself
|
|
30022
30033
|
// to optimize listener registration.
|
|
30023
30034
|
return function wrapListenerIn_markDirtyAndPreventDefault(e) {
|
|
@@ -30030,6 +30041,7 @@ function wrapListener(tNode, lView, context, listenerFn) {
|
|
|
30030
30041
|
// must also mark the component view itself dirty (i.e. the view that it owns).
|
|
30031
30042
|
const startView = isComponentHost(tNode) ? getComponentLViewByIndex(tNode.index, lView) : lView;
|
|
30032
30043
|
markViewDirty(startView, 5 /* NotificationSource.Listener */);
|
|
30044
|
+
const context = lView[CONTEXT];
|
|
30033
30045
|
let result = executeListenerWithErrorHandling(lView, context, listenerFn, e);
|
|
30034
30046
|
// A just-invoked listener function might have coalesced listeners so we need to check for
|
|
30035
30047
|
// their presence and invoke as needed.
|
|
@@ -30066,15 +30078,19 @@ function handleError(lView, error) {
|
|
|
30066
30078
|
errorHandler && errorHandler.handleError(error);
|
|
30067
30079
|
}
|
|
30068
30080
|
|
|
30069
|
-
function listenToOutput(tNode,
|
|
30070
|
-
ngDevMode && assertIndexInRange(lView,
|
|
30071
|
-
const instance = lView[
|
|
30072
|
-
const
|
|
30081
|
+
function listenToOutput(tNode, lView, directiveIndex, lookupName, eventName, listenerFn) {
|
|
30082
|
+
ngDevMode && assertIndexInRange(lView, directiveIndex);
|
|
30083
|
+
const instance = lView[directiveIndex];
|
|
30084
|
+
const tView = lView[TVIEW];
|
|
30085
|
+
const def = tView.data[directiveIndex];
|
|
30073
30086
|
const propertyName = def.outputs[lookupName];
|
|
30074
30087
|
const output = instance[propertyName];
|
|
30075
30088
|
if (ngDevMode && !isOutputSubscribable(output)) {
|
|
30076
30089
|
throw new Error(`@Output ${propertyName} not initialized in '${instance.constructor.name}'.`);
|
|
30077
30090
|
}
|
|
30091
|
+
// TODO(pk): introduce utility to store cleanup or find a different way of sharing code with listener
|
|
30092
|
+
const tCleanup = tView.firstCreatePass ? getOrCreateTViewCleanup(tView) : null;
|
|
30093
|
+
const lCleanup = getOrCreateLViewCleanup(lView);
|
|
30078
30094
|
const subscription = output.subscribe(listenerFn);
|
|
30079
30095
|
const idx = lCleanup.length;
|
|
30080
30096
|
lCleanup.push(listenerFn, subscription);
|
|
@@ -30186,7 +30202,6 @@ function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn,
|
|
|
30186
30202
|
const isTNodeDirectiveHost = isDirectiveHost(tNode);
|
|
30187
30203
|
const firstCreatePass = tView.firstCreatePass;
|
|
30188
30204
|
const tCleanup = firstCreatePass ? getOrCreateTViewCleanup(tView) : null;
|
|
30189
|
-
const context = lView[CONTEXT];
|
|
30190
30205
|
// When the ɵɵlistener instruction was generated and is executed we know that there is either a
|
|
30191
30206
|
// native listener or a directive output on this element. As such we we know that we will have to
|
|
30192
30207
|
// register a listener and store its cleanup function on LView.
|
|
@@ -30237,7 +30252,7 @@ function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn,
|
|
|
30237
30252
|
processOutputs = false;
|
|
30238
30253
|
}
|
|
30239
30254
|
else {
|
|
30240
|
-
listenerFn = wrapListener(tNode, lView,
|
|
30255
|
+
listenerFn = wrapListener(tNode, lView, listenerFn);
|
|
30241
30256
|
stashEventListener(target, eventName, listenerFn);
|
|
30242
30257
|
const cleanupFn = renderer.listen(target, eventName, listenerFn);
|
|
30243
30258
|
ngDevMode && ngDevMode.rendererAddEventListener++;
|
|
@@ -30248,7 +30263,7 @@ function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn,
|
|
|
30248
30263
|
else {
|
|
30249
30264
|
// Even if there is no native listener to add, we still need to wrap the listener so that OnPush
|
|
30250
30265
|
// ancestors are marked dirty when an event occurs.
|
|
30251
|
-
listenerFn = wrapListener(tNode, lView,
|
|
30266
|
+
listenerFn = wrapListener(tNode, lView, listenerFn);
|
|
30252
30267
|
}
|
|
30253
30268
|
if (processOutputs) {
|
|
30254
30269
|
const outputConfig = tNode.outputs?.[eventName];
|
|
@@ -30257,12 +30272,12 @@ function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn,
|
|
|
30257
30272
|
for (let i = 0; i < hostDirectiveOutputConfig.length; i += 2) {
|
|
30258
30273
|
const index = hostDirectiveOutputConfig[i];
|
|
30259
30274
|
const lookupName = hostDirectiveOutputConfig[i + 1];
|
|
30260
|
-
listenToOutput(tNode,
|
|
30275
|
+
listenToOutput(tNode, lView, index, lookupName, eventName, listenerFn);
|
|
30261
30276
|
}
|
|
30262
30277
|
}
|
|
30263
30278
|
if (outputConfig && outputConfig.length) {
|
|
30264
30279
|
for (const index of outputConfig) {
|
|
30265
|
-
listenToOutput(tNode,
|
|
30280
|
+
listenToOutput(tNode, lView, index, eventName, eventName, listenerFn);
|
|
30266
30281
|
}
|
|
30267
30282
|
}
|
|
30268
30283
|
}
|
|
@@ -34636,7 +34651,7 @@ class Version {
|
|
|
34636
34651
|
/**
|
|
34637
34652
|
* @publicApi
|
|
34638
34653
|
*/
|
|
34639
|
-
const VERSION = new Version('19.2.
|
|
34654
|
+
const VERSION = new Version('19.2.6');
|
|
34640
34655
|
|
|
34641
34656
|
/**
|
|
34642
34657
|
* Combination of NgModuleFactory and ComponentFactories.
|