@angular/core 14.0.0-rc.1 → 14.0.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/esm2020/src/di/injector_compatibility.mjs +57 -15
- package/esm2020/src/di/interface/defs.mjs +1 -1
- package/esm2020/src/di/interface/provider.mjs +1 -1
- package/esm2020/src/di/provider_collection.mjs +32 -2
- package/esm2020/src/di/r3_injector.mjs +3 -1
- package/esm2020/src/errors.mjs +1 -1
- package/esm2020/src/metadata/directives.mjs +1 -1
- package/esm2020/src/render3/definition.mjs +3 -3
- package/esm2020/src/render3/features/standalone_feature.mjs +2 -2
- package/esm2020/src/render3/instructions/element.mjs +16 -8
- package/esm2020/src/render3/instructions/shared.mjs +104 -7
- package/esm2020/src/render3/interfaces/definition.mjs +1 -1
- package/esm2020/src/render3/jit/module.mjs +9 -2
- package/esm2020/src/render3/ng_module_ref.mjs +2 -1
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/logger.mjs +3 -3
- package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
- package/esm2020/testing/src/r3_test_bed_compiler.mjs +62 -20
- package/esm2020/testing/src/test_bed.mjs +5 -2
- package/fesm2015/core.mjs +221 -34
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/testing.mjs +24797 -39
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/core.mjs +220 -34
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/testing.mjs +24795 -39
- package/fesm2020/testing.mjs.map +1 -1
- package/index.d.ts +120 -41
- package/package.json +1 -1
- package/testing/index.d.ts +5 -2
|
@@ -28,7 +28,10 @@ export const TestBed = TestBedRender3;
|
|
|
28
28
|
*/
|
|
29
29
|
export const getTestBed = _getTestBedRender3;
|
|
30
30
|
/**
|
|
31
|
-
* Allows injecting dependencies in `beforeEach()` and `it()`.
|
|
31
|
+
* Allows injecting dependencies in `beforeEach()` and `it()`. Note: this function
|
|
32
|
+
* (imported from the `@angular/core/testing` package) can **only** be used to inject dependencies
|
|
33
|
+
* in tests. To inject dependencies in your application code, use the [`inject`](api/core/inject)
|
|
34
|
+
* function from the `@angular/core` package instead.
|
|
32
35
|
*
|
|
33
36
|
* Example:
|
|
34
37
|
*
|
|
@@ -88,4 +91,4 @@ export function withModule(moduleDef, fn) {
|
|
|
88
91
|
}
|
|
89
92
|
return new InjectSetupWrapper(() => moduleDef);
|
|
90
93
|
}
|
|
91
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
94
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdF9iZWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb3JlL3Rlc3Rpbmcvc3JjL3Rlc3RfYmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQU1ILE9BQU8sRUFBQyxrQkFBa0IsRUFBRSxjQUFjLEVBQUMsTUFBTSxlQUFlLENBQUM7QUF5RWpFOzs7Ozs7Ozs7OztHQVdHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sT0FBTyxHQUFrQixjQUFjLENBQUM7QUFFckQ7Ozs7OztHQU1HO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFrQixrQkFBa0IsQ0FBQztBQUU1RDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBcUJHO0FBQ0gsTUFBTSxVQUFVLE1BQU0sQ0FBQyxNQUFhLEVBQUUsRUFBWTtJQUNoRCxNQUFNLE9BQU8sR0FBRyxVQUFVLEVBQUUsQ0FBQztJQUM3Qix3RUFBd0U7SUFDeEUsT0FBTztRQUNMLE9BQU8sT0FBTyxDQUFDLE9BQU8sQ0FBQyxNQUFNLEVBQUUsRUFBRSxFQUFFLElBQUksQ0FBQyxDQUFDO0lBQzNDLENBQUMsQ0FBQztBQUN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lXG4gICAgcmV0dXJuIGZ1bmN0aW9uKHRoaXM6IHVua25vd24pIHtcbiAgICAgIGNvbnN0IHRlc3RCZWQgPSBnZXRUZXN0QmVkKCk7XG4gICAgICBpZiAobW9kdWxlRGVmKSB7XG4gICAgICAgIHRlc3RCZWQuY29uZmlndXJlVGVzdGluZ01vZHVsZShtb2R1bGVEZWYpO1xuICAgICAgfVxuICAgICAgcmV0dXJuIGZuLmFwcGx5KHRoaXMpO1xuICAgIH07XG4gIH1cbiAgcmV0dXJuIG5ldyBJbmplY3RTZXR1cFdyYXBwZXIoKCkgPT4gbW9kdWxlRGVmKTtcbn1cbiJdfQ==
|
package/fesm2015/core.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.0.0
|
|
2
|
+
* @license Angular v14.0.0
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -954,8 +954,8 @@ function ɵɵdefineComponent(componentDefinition) {
|
|
|
954
954
|
*/
|
|
955
955
|
function ɵɵsetComponentScope(type, directives, pipes) {
|
|
956
956
|
const def = type.ɵcmp;
|
|
957
|
-
def.directiveDefs = () => directives.map(extractDirectiveDef);
|
|
958
|
-
def.pipeDefs = () => pipes.map(getPipeDef$1);
|
|
957
|
+
def.directiveDefs = () => (typeof directives === 'function' ? directives() : directives).map(extractDirectiveDef);
|
|
958
|
+
def.pipeDefs = () => (typeof pipes === 'function' ? pipes() : pipes).map(getPipeDef$1);
|
|
959
959
|
}
|
|
960
960
|
function extractDirectiveDef(type) {
|
|
961
961
|
return getComponentDef(type) || getDirectiveDef(type);
|
|
@@ -4837,9 +4837,9 @@ function setCurrentInjector(injector) {
|
|
|
4837
4837
|
function injectInjectorOnly(token, flags = InjectFlags.Default) {
|
|
4838
4838
|
if (_currentInjector === undefined) {
|
|
4839
4839
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
4840
|
-
`inject() must be called from an injection context` :
|
|
4840
|
+
`inject() must be called from an injection context (a constructor, a factory function or a field initializer)` :
|
|
4841
4841
|
'';
|
|
4842
|
-
throw new RuntimeError(203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, errorMessage);
|
|
4842
|
+
throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, errorMessage);
|
|
4843
4843
|
}
|
|
4844
4844
|
else if (_currentInjector === null) {
|
|
4845
4845
|
return injectRootLimpMode(token, undefined, flags);
|
|
@@ -4874,29 +4874,71 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
4874
4874
|
}
|
|
4875
4875
|
/**
|
|
4876
4876
|
* Injects a token from the currently active injector.
|
|
4877
|
-
*
|
|
4878
|
-
*
|
|
4879
|
-
* `
|
|
4880
|
-
*
|
|
4881
|
-
*
|
|
4882
|
-
*
|
|
4883
|
-
*
|
|
4884
|
-
*
|
|
4885
|
-
* @param token
|
|
4877
|
+
* `inject` is only supported during instantiation of a dependency by the DI system. It can be used
|
|
4878
|
+
* during:
|
|
4879
|
+
* - Construction (via the `constructor`) of a class being instantiated by the DI system, such
|
|
4880
|
+
* as an `@Injectable` or `@Component`.
|
|
4881
|
+
* - In the initializer for fields of such classes.
|
|
4882
|
+
* - In the factory function specified for `useFactory` of a `Provider` or an `@Injectable`.
|
|
4883
|
+
* - In the `factory` function specified for an `InjectionToken`.
|
|
4884
|
+
*
|
|
4885
|
+
* @param token A token that represents a dependency that should be injected.
|
|
4886
4886
|
* @param flags Optional flags that control how injection is executed.
|
|
4887
4887
|
* The flags correspond to injection strategies that can be specified with
|
|
4888
4888
|
* parameter decorators `@Host`, `@Self`, `@SkipSef`, and `@Optional`.
|
|
4889
|
-
* @returns the injected value if
|
|
4889
|
+
* @returns the injected value if operation is successful, `null` otherwise.
|
|
4890
|
+
* @throws if called outside of a supported context.
|
|
4890
4891
|
*
|
|
4891
4892
|
* @usageNotes
|
|
4893
|
+
* In practice the `inject()` calls are allowed in a constructor, a constructor parameter and a
|
|
4894
|
+
* field initializer:
|
|
4892
4895
|
*
|
|
4893
|
-
*
|
|
4896
|
+
* ```typescript
|
|
4897
|
+
* @Injectable({providedIn: 'root'})
|
|
4898
|
+
* export class Car {
|
|
4899
|
+
* radio: Radio|undefined;
|
|
4900
|
+
* // OK: field initializer
|
|
4901
|
+
* spareTyre = inject(Tyre);
|
|
4894
4902
|
*
|
|
4895
|
-
* {
|
|
4903
|
+
* constructor() {
|
|
4904
|
+
* // OK: constructor body
|
|
4905
|
+
* this.radio = inject(Radio);
|
|
4906
|
+
* }
|
|
4907
|
+
* }
|
|
4908
|
+
* ```
|
|
4909
|
+
*
|
|
4910
|
+
* It is also legal to call `inject` from a provider's factory:
|
|
4911
|
+
*
|
|
4912
|
+
* ```typescript
|
|
4913
|
+
* providers: [
|
|
4914
|
+
* {provide: Car, useFactory: () => {
|
|
4915
|
+
* // OK: a class factory
|
|
4916
|
+
* const engine = inject(Engine);
|
|
4917
|
+
* return new Car(engine);
|
|
4918
|
+
* }}
|
|
4919
|
+
* ]
|
|
4920
|
+
* ```
|
|
4921
|
+
*
|
|
4922
|
+
* Calls to the `inject()` function outside of the class creation context will result in error. Most
|
|
4923
|
+
* notably, calls to `inject()` are disallowed after a class instance was created, in methods
|
|
4924
|
+
* (including lifecycle hooks):
|
|
4925
|
+
*
|
|
4926
|
+
* ```typescript
|
|
4927
|
+
* @Component({ ... })
|
|
4928
|
+
* export class CarComponent {
|
|
4929
|
+
* ngOnInit() {
|
|
4930
|
+
* // ERROR: too late, the component instance was already created
|
|
4931
|
+
* const engine = inject(Engine);
|
|
4932
|
+
* engine.start();
|
|
4933
|
+
* }
|
|
4934
|
+
* }
|
|
4935
|
+
* ```
|
|
4896
4936
|
*
|
|
4897
4937
|
* @publicApi
|
|
4898
4938
|
*/
|
|
4899
|
-
|
|
4939
|
+
function inject(token, flags = InjectFlags.Default) {
|
|
4940
|
+
return ɵɵinject(token, flags);
|
|
4941
|
+
}
|
|
4900
4942
|
function injectArgs(types) {
|
|
4901
4943
|
const args = [];
|
|
4902
4944
|
for (let i = 0; i < types.length; i++) {
|
|
@@ -8816,8 +8858,38 @@ const INJECTOR_DEF_TYPES = new InjectionToken('INJECTOR_DEF_TYPES');
|
|
|
8816
8858
|
* another environment injector (such as a route injector). They should not be used in component
|
|
8817
8859
|
* providers.
|
|
8818
8860
|
*
|
|
8819
|
-
*
|
|
8861
|
+
* More information about standalone components can be found in [this
|
|
8862
|
+
* guide](guide/standalone-components).
|
|
8863
|
+
*
|
|
8864
|
+
* @usageNotes
|
|
8865
|
+
* The results of the `importProvidersFrom` call can be used in the `bootstrapApplication` call:
|
|
8866
|
+
*
|
|
8867
|
+
* ```typescript
|
|
8868
|
+
* await bootstrapApplication(RootComponent, {
|
|
8869
|
+
* providers: [
|
|
8870
|
+
* importProvidersFrom(NgModuleOne, NgModuleTwo)
|
|
8871
|
+
* ]
|
|
8872
|
+
* });
|
|
8873
|
+
* ```
|
|
8874
|
+
*
|
|
8875
|
+
* You can also use the `importProvidersFrom` results in the `providers` field of a route, when a
|
|
8876
|
+
* standalone component is used:
|
|
8877
|
+
*
|
|
8878
|
+
* ```typescript
|
|
8879
|
+
* export const ROUTES: Route[] = [
|
|
8880
|
+
* {
|
|
8881
|
+
* path: 'foo',
|
|
8882
|
+
* providers: [
|
|
8883
|
+
* importProvidersFrom(NgModuleOne, NgModuleTwo)
|
|
8884
|
+
* ],
|
|
8885
|
+
* component: YourStandaloneComponent
|
|
8886
|
+
* }
|
|
8887
|
+
* ];
|
|
8888
|
+
* ```
|
|
8889
|
+
*
|
|
8890
|
+
* @returns Collected providers from the specified list of types.
|
|
8820
8891
|
* @publicApi
|
|
8892
|
+
* @developerPreview
|
|
8821
8893
|
*/
|
|
8822
8894
|
function importProvidersFrom(...sources) {
|
|
8823
8895
|
return { ɵproviders: internalImportProvidersFrom(true, sources) };
|
|
@@ -9095,6 +9167,8 @@ function getNullInjector() {
|
|
|
9095
9167
|
/**
|
|
9096
9168
|
* An `Injector` that's part of the environment injector hierarchy, which exists outside of the
|
|
9097
9169
|
* component tree.
|
|
9170
|
+
*
|
|
9171
|
+
* @developerPreview
|
|
9098
9172
|
*/
|
|
9099
9173
|
class EnvironmentInjector {
|
|
9100
9174
|
}
|
|
@@ -11354,6 +11428,56 @@ function createTNodeAtIndex(tView, index, type, name, attrs) {
|
|
|
11354
11428
|
}
|
|
11355
11429
|
return tNode;
|
|
11356
11430
|
}
|
|
11431
|
+
/**
|
|
11432
|
+
* WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)
|
|
11433
|
+
* and must **not** be used in production bundles. The function makes megamorphic reads, which might
|
|
11434
|
+
* be too slow for production mode and also it relies on the constructor function being available.
|
|
11435
|
+
*
|
|
11436
|
+
* Gets a reference to the host component def (where a current component is declared).
|
|
11437
|
+
*
|
|
11438
|
+
* @param lView An `LView` that represents a current component that is being rendered.
|
|
11439
|
+
*/
|
|
11440
|
+
function getDeclarationComponentDef(lView) {
|
|
11441
|
+
!ngDevMode && throwError('Must never be called in production mode');
|
|
11442
|
+
const declarationLView = lView[DECLARATION_COMPONENT_VIEW];
|
|
11443
|
+
const context = declarationLView[CONTEXT];
|
|
11444
|
+
// Unable to obtain a context.
|
|
11445
|
+
if (!context)
|
|
11446
|
+
return null;
|
|
11447
|
+
return context.constructor ? getComponentDef(context.constructor) : null;
|
|
11448
|
+
}
|
|
11449
|
+
/**
|
|
11450
|
+
* WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)
|
|
11451
|
+
* and must **not** be used in production bundles. The function makes megamorphic reads, which might
|
|
11452
|
+
* be too slow for production mode.
|
|
11453
|
+
*
|
|
11454
|
+
* Checks if the current component is declared inside of a standalone component template.
|
|
11455
|
+
*
|
|
11456
|
+
* @param lView An `LView` that represents a current component that is being rendered.
|
|
11457
|
+
*/
|
|
11458
|
+
function isHostComponentStandalone(lView) {
|
|
11459
|
+
!ngDevMode && throwError('Must never be called in production mode');
|
|
11460
|
+
const componentDef = getDeclarationComponentDef(lView);
|
|
11461
|
+
// Treat host component as non-standalone if we can't obtain the def.
|
|
11462
|
+
return !!(componentDef === null || componentDef === void 0 ? void 0 : componentDef.standalone);
|
|
11463
|
+
}
|
|
11464
|
+
/**
|
|
11465
|
+
* WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)
|
|
11466
|
+
* and must **not** be used in production bundles. The function makes megamorphic reads, which might
|
|
11467
|
+
* be too slow for production mode.
|
|
11468
|
+
*
|
|
11469
|
+
* Constructs a string describing the location of the host component template. The function is used
|
|
11470
|
+
* in dev mode to produce error messages.
|
|
11471
|
+
*
|
|
11472
|
+
* @param lView An `LView` that represents a current component that is being rendered.
|
|
11473
|
+
*/
|
|
11474
|
+
function getTemplateLocationDetails(lView) {
|
|
11475
|
+
var _a;
|
|
11476
|
+
!ngDevMode && throwError('Must never be called in production mode');
|
|
11477
|
+
const hostComponentDef = getDeclarationComponentDef(lView);
|
|
11478
|
+
const componentClassName = (_a = hostComponentDef === null || hostComponentDef === void 0 ? void 0 : hostComponentDef.type) === null || _a === void 0 ? void 0 : _a.name;
|
|
11479
|
+
return componentClassName ? ` (used in the '${componentClassName}' component template)` : '';
|
|
11480
|
+
}
|
|
11357
11481
|
/**
|
|
11358
11482
|
* When elements are created dynamically after a view blueprint is created (e.g. through
|
|
11359
11483
|
* i18nApply()), we need to adjust the blueprint for future
|
|
@@ -12022,7 +12146,7 @@ function elementPropertyInternal(tView, tNode, lView, propName, value, renderer,
|
|
|
12022
12146
|
validateAgainstEventProperties(propName);
|
|
12023
12147
|
if (!validateProperty(element, tNode.value, propName, tView.schemas)) {
|
|
12024
12148
|
// Return here since we only log warnings for unknown properties.
|
|
12025
|
-
handleUnknownPropertyError(propName, tNode
|
|
12149
|
+
handleUnknownPropertyError(propName, tNode, lView);
|
|
12026
12150
|
return;
|
|
12027
12151
|
}
|
|
12028
12152
|
ngDevMode.rendererSetProperty++;
|
|
@@ -12042,7 +12166,7 @@ function elementPropertyInternal(tView, tNode, lView, propName, value, renderer,
|
|
|
12042
12166
|
// If the node is a container and the property didn't
|
|
12043
12167
|
// match any of the inputs or schemas we should throw.
|
|
12044
12168
|
if (ngDevMode && !matchingSchemas(tView.schemas, tNode.value)) {
|
|
12045
|
-
handleUnknownPropertyError(propName, tNode
|
|
12169
|
+
handleUnknownPropertyError(propName, tNode, lView);
|
|
12046
12170
|
}
|
|
12047
12171
|
}
|
|
12048
12172
|
}
|
|
@@ -12143,13 +12267,60 @@ function matchingSchemas(schemas, tagName) {
|
|
|
12143
12267
|
}
|
|
12144
12268
|
return false;
|
|
12145
12269
|
}
|
|
12270
|
+
/**
|
|
12271
|
+
* The set of known control flow directives.
|
|
12272
|
+
* We use this set to produce a more precises error message with a note
|
|
12273
|
+
* that the `CommonModule` should also be included.
|
|
12274
|
+
*/
|
|
12275
|
+
const KNOWN_CONTROL_FLOW_DIRECTIVES = new Set(['ngIf', 'ngFor', 'ngSwitch', 'ngSwitchCase', 'ngSwitchDefault']);
|
|
12146
12276
|
/**
|
|
12147
12277
|
* Logs or throws an error that a property is not supported on an element.
|
|
12278
|
+
*
|
|
12148
12279
|
* @param propName Name of the invalid property.
|
|
12149
|
-
* @param
|
|
12150
|
-
|
|
12151
|
-
|
|
12152
|
-
|
|
12280
|
+
* @param tNode A `TNode` that represents a current component that is being rendered.
|
|
12281
|
+
* @param lView An `LView` that represents a current component that is being rendered.
|
|
12282
|
+
*/
|
|
12283
|
+
function handleUnknownPropertyError(propName, tNode, lView) {
|
|
12284
|
+
let tagName = tNode.value;
|
|
12285
|
+
// Special-case a situation when a structural directive is applied to
|
|
12286
|
+
// an `<ng-template>` element, for example: `<ng-template *ngIf="true">`.
|
|
12287
|
+
// In this case the compiler generates the `ɵɵtemplate` instruction with
|
|
12288
|
+
// the `null` as the tagName. The directive matching logic at runtime relies
|
|
12289
|
+
// on this effect (see `isInlineTemplate`), thus using the 'ng-template' as
|
|
12290
|
+
// a default value of the `tNode.value` is not feasible at this moment.
|
|
12291
|
+
if (!tagName && tNode.type === 4 /* TNodeType.Container */) {
|
|
12292
|
+
tagName = 'ng-template';
|
|
12293
|
+
}
|
|
12294
|
+
const isHostStandalone = isHostComponentStandalone(lView);
|
|
12295
|
+
const templateLocation = getTemplateLocationDetails(lView);
|
|
12296
|
+
let message = `Can't bind to '${propName}' since it isn't a known property of '${tagName}'${templateLocation}.`;
|
|
12297
|
+
const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;
|
|
12298
|
+
const importLocation = isHostStandalone ?
|
|
12299
|
+
'included in the \'@Component.imports\' of this component' :
|
|
12300
|
+
'a part of an @NgModule where this component is declared';
|
|
12301
|
+
if (KNOWN_CONTROL_FLOW_DIRECTIVES.has(propName)) {
|
|
12302
|
+
// Most likely this is a control flow directive (such as `*ngIf`) used in
|
|
12303
|
+
// a template, but the `CommonModule` is not imported.
|
|
12304
|
+
message += `\nIf the '${propName}' is an Angular control flow directive, ` +
|
|
12305
|
+
`please make sure that the 'CommonModule' is ${importLocation}.`;
|
|
12306
|
+
}
|
|
12307
|
+
else {
|
|
12308
|
+
// May be an Angular component, which is not imported/declared?
|
|
12309
|
+
message += `\n1. If '${tagName}' is an Angular component and it has the ` +
|
|
12310
|
+
`'${propName}' input, then verify that it is ${importLocation}.`;
|
|
12311
|
+
// May be a Web Component?
|
|
12312
|
+
if (tagName && tagName.indexOf('-') > -1) {
|
|
12313
|
+
message += `\n2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' ` +
|
|
12314
|
+
`to the ${schemas} of this component to suppress this message.`;
|
|
12315
|
+
message += `\n3. To allow any property add 'NO_ERRORS_SCHEMA' to ` +
|
|
12316
|
+
`the ${schemas} of this component.`;
|
|
12317
|
+
}
|
|
12318
|
+
else {
|
|
12319
|
+
// If it's expected, the error can be suppressed by the `NO_ERRORS_SCHEMA` schema.
|
|
12320
|
+
message += `\n2. To allow any property add 'NO_ERRORS_SCHEMA' to ` +
|
|
12321
|
+
`the ${schemas} of this component.`;
|
|
12322
|
+
}
|
|
12323
|
+
}
|
|
12153
12324
|
if (shouldThrowErrorOnUnknownProperty) {
|
|
12154
12325
|
throw new RuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message);
|
|
12155
12326
|
}
|
|
@@ -14934,7 +15105,9 @@ function elementStartFirstCreatePass(index, tView, lView, native, name, attrsInd
|
|
|
14934
15105
|
const attrs = getConstant(tViewConsts, attrsIndex);
|
|
14935
15106
|
const tNode = getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, name, attrs);
|
|
14936
15107
|
const hasDirectives = resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
|
|
14937
|
-
|
|
15108
|
+
if (ngDevMode) {
|
|
15109
|
+
validateElementIsKnown(native, lView, tNode.value, tView.schemas, hasDirectives);
|
|
15110
|
+
}
|
|
14938
15111
|
if (tNode.attrs !== null) {
|
|
14939
15112
|
computeStaticStyling(tNode, tNode.attrs, false);
|
|
14940
15113
|
}
|
|
@@ -15071,11 +15244,12 @@ function ɵɵelement(index, name, attrsIndex, localRefsIndex) {
|
|
|
15071
15244
|
* - the element is allowed by one of the schemas
|
|
15072
15245
|
*
|
|
15073
15246
|
* @param element Element to validate
|
|
15247
|
+
* @param lView An `LView` that represents a current component that is being rendered.
|
|
15074
15248
|
* @param tagName Name of the tag to check
|
|
15075
15249
|
* @param schemas Array of schemas
|
|
15076
15250
|
* @param hasDirectives Boolean indicating that the element matches any directive
|
|
15077
15251
|
*/
|
|
15078
|
-
function validateElementIsKnown(element, tagName, schemas, hasDirectives) {
|
|
15252
|
+
function validateElementIsKnown(element, lView, tagName, schemas, hasDirectives) {
|
|
15079
15253
|
// If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT
|
|
15080
15254
|
// mode where this check happens at compile time. In JIT mode, `schemas` is always present and
|
|
15081
15255
|
// defined as an array (as an empty array in case `schemas` field is not defined) and we should
|
|
@@ -15095,14 +15269,19 @@ function validateElementIsKnown(element, tagName, schemas, hasDirectives) {
|
|
|
15095
15269
|
(typeof customElements !== 'undefined' && tagName.indexOf('-') > -1 &&
|
|
15096
15270
|
!customElements.get(tagName));
|
|
15097
15271
|
if (isUnknown && !matchingSchemas(schemas, tagName)) {
|
|
15098
|
-
|
|
15099
|
-
|
|
15272
|
+
const isHostStandalone = isHostComponentStandalone(lView);
|
|
15273
|
+
const templateLocation = getTemplateLocationDetails(lView);
|
|
15274
|
+
const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;
|
|
15275
|
+
let message = `'${tagName}' is not a known element${templateLocation}:\n`;
|
|
15276
|
+
message += `1. If '${tagName}' is an Angular component, then verify that it is ${isHostStandalone ? 'included in the \'@Component.imports\' of this component' :
|
|
15277
|
+
'a part of an @NgModule where this component is declared'}.\n`;
|
|
15100
15278
|
if (tagName && tagName.indexOf('-') > -1) {
|
|
15101
|
-
message +=
|
|
15279
|
+
message +=
|
|
15280
|
+
`2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas} of this component to suppress this message.`;
|
|
15102
15281
|
}
|
|
15103
15282
|
else {
|
|
15104
15283
|
message +=
|
|
15105
|
-
`2. To allow any element add 'NO_ERRORS_SCHEMA' to the
|
|
15284
|
+
`2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas} of this component.`;
|
|
15106
15285
|
}
|
|
15107
15286
|
if (shouldThrowErrorOnUnknownElement) {
|
|
15108
15287
|
throw new RuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message);
|
|
@@ -21595,7 +21774,7 @@ class Version {
|
|
|
21595
21774
|
/**
|
|
21596
21775
|
* @publicApi
|
|
21597
21776
|
*/
|
|
21598
|
-
const VERSION = new Version('14.0.0
|
|
21777
|
+
const VERSION = new Version('14.0.0');
|
|
21599
21778
|
|
|
21600
21779
|
/**
|
|
21601
21780
|
* @license
|
|
@@ -22267,6 +22446,7 @@ class EnvironmentNgModuleRefAdapter extends NgModuleRef$1 {
|
|
|
22267
22446
|
* Create a new environment injector.
|
|
22268
22447
|
*
|
|
22269
22448
|
* @publicApi
|
|
22449
|
+
* @developerPreview
|
|
22270
22450
|
*/
|
|
22271
22451
|
function createEnvironmentInjector(providers, parent = null, debugName = null) {
|
|
22272
22452
|
const adapter = new EnvironmentNgModuleRefAdapter(providers, parent, debugName);
|
|
@@ -22323,7 +22503,7 @@ StandaloneService.ɵprov = ɵɵdefineInjectable({
|
|
|
22323
22503
|
factory: () => new StandaloneService(ɵɵinject(EnvironmentInjector)),
|
|
22324
22504
|
});
|
|
22325
22505
|
/**
|
|
22326
|
-
* A feature that acts as a setup code for the {@
|
|
22506
|
+
* A feature that acts as a setup code for the {@link StandaloneService}.
|
|
22327
22507
|
*
|
|
22328
22508
|
* The most important responsaibility of this feature is to expose the "getStandaloneInjector"
|
|
22329
22509
|
* function (an entry points to a standalone injector creation) on a component definition object. We
|
|
@@ -24396,6 +24576,12 @@ function isStandalone(type) {
|
|
|
24396
24576
|
const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef$1(type);
|
|
24397
24577
|
return def !== null ? def.standalone : false;
|
|
24398
24578
|
}
|
|
24579
|
+
function generateStandaloneInDeclarationsError(type, location) {
|
|
24580
|
+
const prefix = `Unexpected "${stringifyForError(type)}" found in the "declarations" array of the`;
|
|
24581
|
+
const suffix = `"${stringifyForError(type)}" is marked as standalone and can't be declared ` +
|
|
24582
|
+
'in any NgModule - did you intend to import it instead (by adding it to the "imports" array)?';
|
|
24583
|
+
return `${prefix} ${location}, ${suffix}`;
|
|
24584
|
+
}
|
|
24399
24585
|
function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRoot, importingModule) {
|
|
24400
24586
|
if (verifiedNgModule.get(moduleType))
|
|
24401
24587
|
return;
|
|
@@ -24467,7 +24653,8 @@ function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRo
|
|
|
24467
24653
|
type = resolveForwardRef(type);
|
|
24468
24654
|
const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef$1(type);
|
|
24469
24655
|
if (def === null || def === void 0 ? void 0 : def.standalone) {
|
|
24470
|
-
|
|
24656
|
+
const location = `"${stringifyForError(moduleType)}" NgModule`;
|
|
24657
|
+
errors.push(generateStandaloneInDeclarationsError(type, location));
|
|
24471
24658
|
}
|
|
24472
24659
|
}
|
|
24473
24660
|
function verifyExportsAreDeclaredOrReExported(type) {
|