@angular/core 12.1.0-next.6 → 12.1.3
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/bundles/core-testing.umd.js +239 -46
- package/bundles/core-testing.umd.js.map +1 -1
- package/bundles/core.umd.js +126 -49
- package/bundles/core.umd.js.map +1 -1
- package/core.d.ts +45 -19
- package/core.metadata.json +1 -1
- package/esm2015/src/application_init.js +5 -5
- package/esm2015/src/application_ref.js +34 -9
- package/esm2015/src/change_detection/differs/iterable_differs.js +1 -1
- package/esm2015/src/compiler/compiler_facade.js +31 -8
- package/esm2015/src/compiler/compiler_facade_interface.js +1 -1
- package/esm2015/src/di/jit/injectable.js +4 -3
- package/esm2015/src/di/r3_injector.js +5 -2
- package/esm2015/src/error_handler.js +2 -6
- package/esm2015/src/event_emitter.js +1 -1
- package/esm2015/src/linker/component_factory_resolver.js +1 -1
- package/esm2015/src/linker/template_ref.js +1 -1
- package/esm2015/src/linker/view_container_ref.js +1 -1
- package/esm2015/src/metadata/di.js +1 -1
- package/esm2015/src/metadata/do_boostrap.js +1 -1
- package/esm2015/src/render3/component_ref.js +1 -1
- package/esm2015/src/render3/jit/directive.js +6 -5
- package/esm2015/src/render3/jit/module.js +7 -4
- package/esm2015/src/render3/jit/partial.js +27 -9
- package/esm2015/src/render3/jit/pipe.js +5 -3
- package/esm2015/src/render3/ng_module_ref.js +1 -1
- package/esm2015/src/render3/view_ref.js +1 -1
- package/esm2015/src/sanitization/bypass.js +1 -1
- package/esm2015/src/version.js +1 -1
- package/esm2015/src/view/entrypoint.js +1 -1
- package/esm2015/src/view/refs.js +1 -1
- package/esm2015/testing/src/ng_zone_mock.js +1 -1
- package/esm2015/testing/src/r3_test_bed.js +84 -7
- package/esm2015/testing/src/r3_test_bed_compiler.js +4 -1
- package/esm2015/testing/src/resolvers.js +1 -1
- package/esm2015/testing/src/test_bed.js +110 -21
- package/esm2015/testing/src/test_bed_common.js +7 -1
- package/esm2015/testing/src/test_hooks.js +45 -0
- package/esm2015/testing/src/testing.js +3 -3
- package/fesm2015/core.js +116 -45
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/testing.js +216 -29
- package/fesm2015/testing.js.map +1 -1
- package/package.json +1 -1
- package/schematics/migrations/missing-injectable/providers_evaluator.js +1 -1
- package/schematics/migrations/static-queries/strategies/usage_strategy/template_usage_visitor.js +1 -1
- package/schematics/migrations/template-var-assignment/angular/html_variable_assignment_visitor.js +1 -1
- package/schematics/migrations.json +1 -1
- package/src/r3_symbols.d.ts +2 -3
- package/testing/testing.d.ts +64 -5
- package/testing/testing.metadata.json +1 -1
- package/testing.d.ts +1 -1
- package/esm2015/testing/src/before_each.js +0 -33
- package/schematics/migrations/abstract-control-parent/abstract-control-parent.externs.js +0 -0
- package/schematics/migrations/abstract-control-parent/index.mjs +0 -47
- package/schematics/migrations/abstract-control-parent/util.mjs +0 -50
- package/schematics/migrations/activated-route-snapshot-fragment/activated-route-snapshot-fragment.externs.js +0 -0
- package/schematics/migrations/activated-route-snapshot-fragment/index.mjs +0 -48
- package/schematics/migrations/activated-route-snapshot-fragment/util.mjs +0 -33
- package/schematics/migrations/can-activate-with-redirect-to/can-activate-with-redirect-to.externs.js +0 -0
- package/schematics/migrations/can-activate-with-redirect-to/index.mjs +0 -44
- package/schematics/migrations/can-activate-with-redirect-to/util.mjs +0 -55
- package/schematics/migrations/deep-shadow-piercing-selector/deep-shadow-piercing-selector.externs.js +0 -0
- package/schematics/migrations/deep-shadow-piercing-selector/index.mjs +0 -36
- package/schematics/migrations/dynamic-queries/dynamic-queries.externs.js +0 -0
- package/schematics/migrations/dynamic-queries/index.mjs +0 -51
- package/schematics/migrations/dynamic-queries/util.mjs +0 -65
- package/schematics/migrations/initial-navigation/collector.mjs +0 -105
- package/schematics/migrations/initial-navigation/index.mjs +0 -61
- package/schematics/migrations/initial-navigation/initial-navigation.externs.js +0 -0
- package/schematics/migrations/initial-navigation/transform.mjs +0 -54
- package/schematics/migrations/initial-navigation/update_recorder.mjs +0 -9
- package/schematics/migrations/initial-navigation/util.mjs +0 -28
- package/schematics/migrations/missing-injectable/definition_collector.mjs +0 -75
- package/schematics/migrations/missing-injectable/index.mjs +0 -100
- package/schematics/migrations/missing-injectable/missing-injectable.externs.js +0 -0
- package/schematics/migrations/missing-injectable/providers_evaluator.mjs +0 -50
- package/schematics/migrations/missing-injectable/transform.mjs +0 -187
- package/schematics/migrations/missing-injectable/update_recorder.mjs +0 -9
- package/schematics/migrations/module-with-providers/collector.mjs +0 -59
- package/schematics/migrations/module-with-providers/index.mjs +0 -71
- package/schematics/migrations/module-with-providers/module-with-providers.externs.js +0 -0
- package/schematics/migrations/module-with-providers/transform.mjs +0 -134
- package/schematics/migrations/module-with-providers/util.mjs +0 -25
- package/schematics/migrations/move-document/document_import_visitor.mjs +0 -60
- package/schematics/migrations/move-document/index.mjs +0 -71
- package/schematics/migrations/move-document/move-document.externs.js +0 -0
- package/schematics/migrations/move-document/move-import.mjs +0 -45
- package/schematics/migrations/native-view-encapsulation/index.mjs +0 -41
- package/schematics/migrations/native-view-encapsulation/native-view-encapsulation.externs.js +0 -0
- package/schematics/migrations/native-view-encapsulation/util.mjs +0 -34
- package/schematics/migrations/navigation-extras-omissions/index.mjs +0 -47
- package/schematics/migrations/navigation-extras-omissions/navigation-extras-omissions.externs.js +0 -0
- package/schematics/migrations/navigation-extras-omissions/util.mjs +0 -111
- package/schematics/migrations/relative-link-resolution/collector.mjs +0 -81
- package/schematics/migrations/relative-link-resolution/index.mjs +0 -62
- package/schematics/migrations/relative-link-resolution/relative-link-resolution.externs.js +0 -0
- package/schematics/migrations/relative-link-resolution/transform.mjs +0 -51
- package/schematics/migrations/relative-link-resolution/update_recorder.mjs +0 -9
- package/schematics/migrations/relative-link-resolution/util.mjs +0 -28
- package/schematics/migrations/renderer-to-renderer2/helpers.mjs +0 -224
- package/schematics/migrations/renderer-to-renderer2/index.mjs +0 -113
- package/schematics/migrations/renderer-to-renderer2/migration.mjs +0 -211
- package/schematics/migrations/renderer-to-renderer2/renderer-to-renderer2.externs.js +0 -0
- package/schematics/migrations/renderer-to-renderer2/util.mjs +0 -69
- package/schematics/migrations/router-preserve-query-params/index.mjs +0 -50
- package/schematics/migrations/router-preserve-query-params/router-preserve-query-params.externs.js +0 -0
- package/schematics/migrations/router-preserve-query-params/util.mjs +0 -88
- package/schematics/migrations/static-queries/angular/directive_inputs.mjs +0 -70
- package/schematics/migrations/static-queries/angular/ng_query_visitor.mjs +0 -113
- package/schematics/migrations/static-queries/angular/query-definition.mjs +0 -20
- package/schematics/migrations/static-queries/angular/super_class.mjs +0 -21
- package/schematics/migrations/static-queries/index.mjs +0 -206
- package/schematics/migrations/static-queries/static-queries.externs.js +0 -0
- package/schematics/migrations/static-queries/strategies/template_strategy/template_strategy.mjs +0 -200
- package/schematics/migrations/static-queries/strategies/test_strategy/test_strategy.mjs +0 -24
- package/schematics/migrations/static-queries/strategies/timing-strategy.mjs +0 -9
- package/schematics/migrations/static-queries/strategies/usage_strategy/declaration_usage_visitor.mjs +0 -355
- package/schematics/migrations/static-queries/strategies/usage_strategy/super_class_context.mjs +0 -38
- package/schematics/migrations/static-queries/strategies/usage_strategy/template_usage_visitor.mjs +0 -80
- package/schematics/migrations/static-queries/strategies/usage_strategy/usage_strategy.mjs +0 -154
- package/schematics/migrations/static-queries/transform.mjs +0 -88
- package/schematics/migrations/template-var-assignment/analyze_template.mjs +0 -25
- package/schematics/migrations/template-var-assignment/angular/html_variable_assignment_visitor.mjs +0 -65
- package/schematics/migrations/template-var-assignment/index.mjs +0 -68
- package/schematics/migrations/template-var-assignment/template-var-assignment.externs.js +0 -0
- package/schematics/migrations/undecorated-classes-with-decorated-fields/index.mjs +0 -92
- package/schematics/migrations/undecorated-classes-with-decorated-fields/transform.mjs +0 -286
- package/schematics/migrations/undecorated-classes-with-decorated-fields/undecorated-classes-with-decorated-fields.externs.js +0 -0
- package/schematics/migrations/undecorated-classes-with-decorated-fields/update_recorder.mjs +0 -9
- package/schematics/migrations/undecorated-classes-with-di/create_ngc_program.mjs +0 -43
- package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/convert_directive_metadata.mjs +0 -82
- package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/decorator_rewriter.mjs +0 -102
- package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/import_rewrite_visitor.mjs +0 -111
- package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/path_format.mjs +0 -17
- package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/source_file_exports.mjs +0 -51
- package/schematics/migrations/undecorated-classes-with-di/index.mjs +0 -162
- package/schematics/migrations/undecorated-classes-with-di/ng_declaration_collector.mjs +0 -124
- package/schematics/migrations/undecorated-classes-with-di/transform.mjs +0 -356
- package/schematics/migrations/undecorated-classes-with-di/undecorated-classes-with-di.externs.js +0 -0
- package/schematics/migrations/undecorated-classes-with-di/update_recorder.mjs +0 -9
- package/schematics/migrations/wait-for-async/index.mjs +0 -76
- package/schematics/migrations/wait-for-async/util.mjs +0 -23
- package/schematics/migrations/wait-for-async/wait-for-async.externs.js +0 -0
- package/schematics/migrations/xhr-factory/index.mjs +0 -91
- package/schematics/migrations/xhr-factory/xhr-factory.externs.js +0 -0
- package/schematics/utils/import_manager.mjs +0 -197
- package/schematics/utils/line_mappings.mjs +0 -60
- package/schematics/utils/ng_component_template.mjs +0 -96
- package/schematics/utils/ng_decorators.mjs +0 -23
- package/schematics/utils/parse_html.mjs +0 -24
- package/schematics/utils/project_tsconfig_paths.mjs +0 -74
- package/schematics/utils/schematics_prompt.mjs +0 -30
- package/schematics/utils/typescript/class_declaration.mjs +0 -33
- package/schematics/utils/typescript/compiler_host.mjs +0 -66
- package/schematics/utils/typescript/decorators.mjs +0 -20
- package/schematics/utils/typescript/find_base_classes.mjs +0 -30
- package/schematics/utils/typescript/functions.mjs +0 -28
- package/schematics/utils/typescript/imports.mjs +0 -91
- package/schematics/utils/typescript/nodes.mjs +0 -57
- package/schematics/utils/typescript/parse_tsconfig.mjs +0 -26
- package/schematics/utils/typescript/property_name.mjs +0 -23
- package/schematics/utils/typescript/symbol.mjs +0 -72
- package/schematics/utils/utils.externs.js +0 -0
package/fesm2015/core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v12.1.
|
|
2
|
+
* @license Angular v12.1.3
|
|
3
3
|
* (c) 2010-2021 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -4025,15 +4025,38 @@ var ViewEncapsulation$1;
|
|
|
4025
4025
|
* Use of this source code is governed by an MIT-style license that can be
|
|
4026
4026
|
* found in the LICENSE file at https://angular.io/license
|
|
4027
4027
|
*/
|
|
4028
|
-
function getCompilerFacade() {
|
|
4028
|
+
function getCompilerFacade(request) {
|
|
4029
4029
|
const globalNg = _global['ng'];
|
|
4030
|
-
if (
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4030
|
+
if (globalNg && globalNg.ɵcompilerFacade) {
|
|
4031
|
+
return globalNg.ɵcompilerFacade;
|
|
4032
|
+
}
|
|
4033
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
4034
|
+
// Log the type as an error so that a developer can easily navigate to the type from the
|
|
4035
|
+
// console.
|
|
4036
|
+
console.error(`JIT compilation failed for ${request.kind}`, request.type);
|
|
4037
|
+
let message = `The ${request.kind} '${request
|
|
4038
|
+
.type.name}' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.\n\n`;
|
|
4039
|
+
if (request.usage === 1 /* PartialDeclaration */) {
|
|
4040
|
+
message += `The ${request.kind} is part of a library that has been partially compiled.\n`;
|
|
4041
|
+
message +=
|
|
4042
|
+
`However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.\n`;
|
|
4043
|
+
message += '\n';
|
|
4044
|
+
message +=
|
|
4045
|
+
`Ideally, the library is processed using the Angular Linker to become fully AOT compiled.\n`;
|
|
4046
|
+
}
|
|
4047
|
+
else {
|
|
4048
|
+
message +=
|
|
4049
|
+
`JIT compilation is discouraged for production use-cases! Consider using AOT mode instead.\n`;
|
|
4050
|
+
}
|
|
4051
|
+
message +=
|
|
4052
|
+
`Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server',\n`;
|
|
4053
|
+
message +=
|
|
4054
|
+
`or manually provide the compiler with 'import "@angular/compiler";' before bootstrapping.`;
|
|
4055
|
+
throw new Error(message);
|
|
4056
|
+
}
|
|
4057
|
+
else {
|
|
4058
|
+
throw new Error('JIT compiler unavailable');
|
|
4035
4059
|
}
|
|
4036
|
-
return globalNg.ɵcompilerFacade;
|
|
4037
4060
|
}
|
|
4038
4061
|
|
|
4039
4062
|
/**
|
|
@@ -6511,11 +6534,7 @@ class ErrorHandler {
|
|
|
6511
6534
|
}
|
|
6512
6535
|
/** @internal */
|
|
6513
6536
|
_findContext(error) {
|
|
6514
|
-
|
|
6515
|
-
return getDebugContext(error) ? getDebugContext(error) :
|
|
6516
|
-
this._findContext(getOriginalError(error));
|
|
6517
|
-
}
|
|
6518
|
-
return null;
|
|
6537
|
+
return error ? (getDebugContext(error) || this._findContext(getOriginalError(error))) : null;
|
|
6519
6538
|
}
|
|
6520
6539
|
/** @internal */
|
|
6521
6540
|
_findOriginalError(error) {
|
|
@@ -11212,6 +11231,7 @@ class R3Injector {
|
|
|
11212
11231
|
this.assertNotDestroyed();
|
|
11213
11232
|
// Set the injection context.
|
|
11214
11233
|
const previousInjector = setCurrentInjector(this);
|
|
11234
|
+
const previousInjectImplementation = setInjectImplementation(undefined);
|
|
11215
11235
|
try {
|
|
11216
11236
|
// Check for the SkipSelf flag.
|
|
11217
11237
|
if (!(flags & InjectFlags.SkipSelf)) {
|
|
@@ -11264,7 +11284,8 @@ class R3Injector {
|
|
|
11264
11284
|
}
|
|
11265
11285
|
}
|
|
11266
11286
|
finally {
|
|
11267
|
-
// Lastly,
|
|
11287
|
+
// Lastly, restore the previous injection context.
|
|
11288
|
+
setInjectImplementation(previousInjectImplementation);
|
|
11268
11289
|
setCurrentInjector(previousInjector);
|
|
11269
11290
|
}
|
|
11270
11291
|
}
|
|
@@ -13673,7 +13694,8 @@ function compileInjectable(type, meta) {
|
|
|
13673
13694
|
Object.defineProperty(type, NG_PROV_DEF, {
|
|
13674
13695
|
get: () => {
|
|
13675
13696
|
if (ngInjectableDef === null) {
|
|
13676
|
-
|
|
13697
|
+
const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'injectable', type });
|
|
13698
|
+
ngInjectableDef = compiler.compileInjectable(angularCoreDiEnv, `ng:///${type.name}/ɵprov.js`, getInjectableMetadata(type, meta));
|
|
13677
13699
|
}
|
|
13678
13700
|
return ngInjectableDef;
|
|
13679
13701
|
},
|
|
@@ -13684,7 +13706,7 @@ function compileInjectable(type, meta) {
|
|
|
13684
13706
|
Object.defineProperty(type, NG_FACTORY_DEF, {
|
|
13685
13707
|
get: () => {
|
|
13686
13708
|
if (ngFactoryDef === null) {
|
|
13687
|
-
const compiler = getCompilerFacade();
|
|
13709
|
+
const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'injectable', type });
|
|
13688
13710
|
ngFactoryDef = compiler.compileFactory(angularCoreDiEnv, `ng:///${type.name}/ɵfac.js`, {
|
|
13689
13711
|
name: type.name,
|
|
13690
13712
|
type,
|
|
@@ -21469,7 +21491,7 @@ class Version {
|
|
|
21469
21491
|
/**
|
|
21470
21492
|
* @publicApi
|
|
21471
21493
|
*/
|
|
21472
|
-
const VERSION = new Version('12.1.
|
|
21494
|
+
const VERSION = new Version('12.1.3');
|
|
21473
21495
|
|
|
21474
21496
|
/**
|
|
21475
21497
|
* @license
|
|
@@ -26928,7 +26950,8 @@ function compileNgModuleDefs(moduleType, ngModule, allowDuplicateDeclarationsInR
|
|
|
26928
26950
|
// go into an infinite loop before we've reached the point where we throw all the errors.
|
|
26929
26951
|
throw new Error(`'${stringifyForError(moduleType)}' module can't import itself`);
|
|
26930
26952
|
}
|
|
26931
|
-
|
|
26953
|
+
const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'NgModule', type: moduleType });
|
|
26954
|
+
ngModuleDef = compiler.compileNgModule(angularCoreEnv, `ng:///${moduleType.name}/ɵmod.js`, {
|
|
26932
26955
|
type: moduleType,
|
|
26933
26956
|
bootstrap: flatten(ngModule.bootstrap || EMPTY_ARRAY).map(resolveForwardRef),
|
|
26934
26957
|
declarations: declarations.map(resolveForwardRef),
|
|
@@ -26956,7 +26979,7 @@ function compileNgModuleDefs(moduleType, ngModule, allowDuplicateDeclarationsInR
|
|
|
26956
26979
|
Object.defineProperty(moduleType, NG_FACTORY_DEF, {
|
|
26957
26980
|
get: () => {
|
|
26958
26981
|
if (ngFactoryDef === null) {
|
|
26959
|
-
const compiler = getCompilerFacade();
|
|
26982
|
+
const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'NgModule', type: moduleType });
|
|
26960
26983
|
ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${moduleType.name}/ɵfac.js`, {
|
|
26961
26984
|
name: moduleType.name,
|
|
26962
26985
|
type: moduleType,
|
|
@@ -26985,7 +27008,9 @@ function compileNgModuleDefs(moduleType, ngModule, allowDuplicateDeclarationsInR
|
|
|
26985
27008
|
(ngModule.exports || EMPTY_ARRAY).map(resolveForwardRef),
|
|
26986
27009
|
],
|
|
26987
27010
|
};
|
|
26988
|
-
|
|
27011
|
+
const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'NgModule', type: moduleType });
|
|
27012
|
+
ngInjectorDef =
|
|
27013
|
+
compiler.compileInjector(angularCoreEnv, `ng:///${moduleType.name}/ɵinj.js`, meta);
|
|
26989
27014
|
}
|
|
26990
27015
|
return ngInjectorDef;
|
|
26991
27016
|
},
|
|
@@ -27351,7 +27376,7 @@ function compileComponent(type, metadata) {
|
|
|
27351
27376
|
Object.defineProperty(type, NG_COMP_DEF, {
|
|
27352
27377
|
get: () => {
|
|
27353
27378
|
if (ngComponentDef === null) {
|
|
27354
|
-
const compiler = getCompilerFacade();
|
|
27379
|
+
const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'component', type: type });
|
|
27355
27380
|
if (componentNeedsResolution(metadata)) {
|
|
27356
27381
|
const error = [`Component '${type.name}' is not resolved:`];
|
|
27357
27382
|
if (metadata.templateUrl) {
|
|
@@ -27442,8 +27467,9 @@ function compileDirective(type, directive) {
|
|
|
27442
27467
|
// that use `@Directive()` with no selector. In that case, pass empty object to the
|
|
27443
27468
|
// `directiveMetadata` function instead of null.
|
|
27444
27469
|
const meta = getDirectiveMetadata$1(type, directive || {});
|
|
27470
|
+
const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'directive', type });
|
|
27445
27471
|
ngDirectiveDef =
|
|
27446
|
-
|
|
27472
|
+
compiler.compileDirective(angularCoreEnv, meta.sourceMapUrl, meta.metadata);
|
|
27447
27473
|
}
|
|
27448
27474
|
return ngDirectiveDef;
|
|
27449
27475
|
},
|
|
@@ -27454,7 +27480,7 @@ function compileDirective(type, directive) {
|
|
|
27454
27480
|
function getDirectiveMetadata$1(type, metadata) {
|
|
27455
27481
|
const name = type && type.name;
|
|
27456
27482
|
const sourceMapUrl = `ng:///${name}/ɵdir.js`;
|
|
27457
|
-
const compiler = getCompilerFacade();
|
|
27483
|
+
const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'directive', type });
|
|
27458
27484
|
const facade = directiveMetadata(type, metadata);
|
|
27459
27485
|
facade.typeSourceSpan = compiler.createParseSourceSpan('Directive', name, sourceMapUrl);
|
|
27460
27486
|
if (facade.usesInheritance) {
|
|
@@ -27468,7 +27494,7 @@ function addDirectiveFactoryDef(type, metadata) {
|
|
|
27468
27494
|
get: () => {
|
|
27469
27495
|
if (ngFactoryDef === null) {
|
|
27470
27496
|
const meta = getDirectiveMetadata$1(type, metadata);
|
|
27471
|
-
const compiler = getCompilerFacade();
|
|
27497
|
+
const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'directive', type });
|
|
27472
27498
|
ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${type.name}/ɵfac.js`, {
|
|
27473
27499
|
name: meta.metadata.name,
|
|
27474
27500
|
type: meta.metadata.type,
|
|
@@ -27619,7 +27645,7 @@ function compilePipe(type, meta) {
|
|
|
27619
27645
|
get: () => {
|
|
27620
27646
|
if (ngFactoryDef === null) {
|
|
27621
27647
|
const metadata = getPipeMetadata(type, meta);
|
|
27622
|
-
const compiler = getCompilerFacade();
|
|
27648
|
+
const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'pipe', type: metadata.type });
|
|
27623
27649
|
ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${metadata.name}/ɵfac.js`, {
|
|
27624
27650
|
name: metadata.name,
|
|
27625
27651
|
type: metadata.type,
|
|
@@ -27637,7 +27663,9 @@ function compilePipe(type, meta) {
|
|
|
27637
27663
|
get: () => {
|
|
27638
27664
|
if (ngPipeDef === null) {
|
|
27639
27665
|
const metadata = getPipeMetadata(type, meta);
|
|
27640
|
-
|
|
27666
|
+
const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'pipe', type: metadata.type });
|
|
27667
|
+
ngPipeDef =
|
|
27668
|
+
compiler.compilePipe(angularCoreEnv, `ng:///${metadata.name}/ɵpipe.js`, metadata);
|
|
27641
27669
|
}
|
|
27642
27670
|
return ngPipeDef;
|
|
27643
27671
|
},
|
|
@@ -27877,11 +27905,11 @@ const SWITCH_COMPILE_NGMODULE = SWITCH_COMPILE_NGMODULE__PRE_R3__;
|
|
|
27877
27905
|
* through DI.
|
|
27878
27906
|
*
|
|
27879
27907
|
* ```
|
|
27880
|
-
* function
|
|
27881
|
-
* return httpClient.get("https://someUrl.com/api/user")
|
|
27908
|
+
* function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
|
|
27909
|
+
* return () => httpClient.get("https://someUrl.com/api/user")
|
|
27882
27910
|
* .pipe(
|
|
27883
27911
|
* tap(user => { ... })
|
|
27884
|
-
* )
|
|
27912
|
+
* );
|
|
27885
27913
|
* }
|
|
27886
27914
|
*
|
|
27887
27915
|
* @NgModule({
|
|
@@ -27890,7 +27918,7 @@ const SWITCH_COMPILE_NGMODULE = SWITCH_COMPILE_NGMODULE__PRE_R3__;
|
|
|
27890
27918
|
* bootstrap: [AppComponent],
|
|
27891
27919
|
* providers: [{
|
|
27892
27920
|
* provide: APP_INITIALIZER,
|
|
27893
|
-
* useFactory:
|
|
27921
|
+
* useFactory: initializeAppFactory,
|
|
27894
27922
|
* deps: [HttpClient],
|
|
27895
27923
|
* multi: true
|
|
27896
27924
|
* }]
|
|
@@ -29085,7 +29113,11 @@ function compileNgModuleFactory__POST_R3__(injector, options, moduleType) {
|
|
|
29085
29113
|
if (compilerProviders.length === 0) {
|
|
29086
29114
|
return Promise.resolve(moduleFactory);
|
|
29087
29115
|
}
|
|
29088
|
-
const compiler = getCompilerFacade(
|
|
29116
|
+
const compiler = getCompilerFacade({
|
|
29117
|
+
usage: 0 /* Decorator */,
|
|
29118
|
+
kind: 'NgModule',
|
|
29119
|
+
type: moduleType,
|
|
29120
|
+
});
|
|
29089
29121
|
const compilerInjector = Injector.create({ providers: compilerProviders });
|
|
29090
29122
|
const resourceLoader = compilerInjector.get(compiler.ResourceLoader);
|
|
29091
29123
|
// The resource loader can also return a string while the "resolveComponentResources"
|
|
@@ -29567,20 +29599,41 @@ class ApplicationRef {
|
|
|
29567
29599
|
merge$1(isCurrentlyStable, isStable.pipe(share()));
|
|
29568
29600
|
}
|
|
29569
29601
|
/**
|
|
29570
|
-
* Bootstrap a
|
|
29602
|
+
* Bootstrap a component onto the element identified by its selector or, optionally, to a
|
|
29603
|
+
* specified element.
|
|
29571
29604
|
*
|
|
29572
29605
|
* @usageNotes
|
|
29573
29606
|
* ### Bootstrap process
|
|
29574
29607
|
*
|
|
29575
|
-
* When bootstrapping a
|
|
29576
|
-
*
|
|
29577
|
-
*
|
|
29608
|
+
* When bootstrapping a component, Angular mounts it onto a target DOM element
|
|
29609
|
+
* and kicks off automatic change detection. The target DOM element can be
|
|
29610
|
+
* provided using the `rootSelectorOrNode` argument.
|
|
29578
29611
|
*
|
|
29579
|
-
*
|
|
29580
|
-
*
|
|
29612
|
+
* If the target DOM element is not provided, Angular tries to find one on a page
|
|
29613
|
+
* using the `selector` of the component that is being bootstrapped
|
|
29614
|
+
* (first matched element is used).
|
|
29581
29615
|
*
|
|
29582
29616
|
* ### Example
|
|
29583
|
-
*
|
|
29617
|
+
*
|
|
29618
|
+
* Generally, we define the component to bootstrap in the `bootstrap` array of `NgModule`,
|
|
29619
|
+
* but it requires us to know the component while writing the application code.
|
|
29620
|
+
*
|
|
29621
|
+
* Imagine a situation where we have to wait for an API call to decide about the component to
|
|
29622
|
+
* bootstrap. We can use the `ngDoBootstrap` hook of the `NgModule` and call this method to
|
|
29623
|
+
* dynamically bootstrap a component.
|
|
29624
|
+
*
|
|
29625
|
+
* {@example core/ts/platform/platform.ts region='componentSelector'}
|
|
29626
|
+
*
|
|
29627
|
+
* Optionally, a component can be mounted onto a DOM element that does not match the
|
|
29628
|
+
* selector of the bootstrapped component.
|
|
29629
|
+
*
|
|
29630
|
+
* In the following example, we are providing a CSS selector to match the target element.
|
|
29631
|
+
*
|
|
29632
|
+
* {@example core/ts/platform/platform.ts region='cssSelector'}
|
|
29633
|
+
*
|
|
29634
|
+
* While in this example, we are providing reference to a DOM node.
|
|
29635
|
+
*
|
|
29636
|
+
* {@example core/ts/platform/platform.ts region='domNode'}
|
|
29584
29637
|
*/
|
|
29585
29638
|
bootstrap(componentOrFactory, rootSelectorOrNode) {
|
|
29586
29639
|
if (!this._initStatus.done) {
|
|
@@ -33006,7 +33059,7 @@ class NgModuleFactory_ extends NgModuleFactory {
|
|
|
33006
33059
|
* @codeGenApi
|
|
33007
33060
|
*/
|
|
33008
33061
|
function ɵɵngDeclareDirective(decl) {
|
|
33009
|
-
const compiler = getCompilerFacade();
|
|
33062
|
+
const compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'directive', type: decl.type });
|
|
33010
33063
|
return compiler.compileDirectiveDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵfac.js`, decl);
|
|
33011
33064
|
}
|
|
33012
33065
|
/**
|
|
@@ -33024,7 +33077,7 @@ function ɵɵngDeclareClassMetadata(decl) {
|
|
|
33024
33077
|
* @codeGenApi
|
|
33025
33078
|
*/
|
|
33026
33079
|
function ɵɵngDeclareComponent(decl) {
|
|
33027
|
-
const compiler = getCompilerFacade();
|
|
33080
|
+
const compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'component', type: decl.type });
|
|
33028
33081
|
return compiler.compileComponentDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵcmp.js`, decl);
|
|
33029
33082
|
}
|
|
33030
33083
|
/**
|
|
@@ -33033,16 +33086,34 @@ function ɵɵngDeclareComponent(decl) {
|
|
|
33033
33086
|
* @codeGenApi
|
|
33034
33087
|
*/
|
|
33035
33088
|
function ɵɵngDeclareFactory(decl) {
|
|
33036
|
-
const compiler = getCompilerFacade(
|
|
33089
|
+
const compiler = getCompilerFacade({
|
|
33090
|
+
usage: 1 /* PartialDeclaration */,
|
|
33091
|
+
kind: getFactoryKind(decl.target),
|
|
33092
|
+
type: decl.type
|
|
33093
|
+
});
|
|
33037
33094
|
return compiler.compileFactoryDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵfac.js`, decl);
|
|
33038
33095
|
}
|
|
33096
|
+
function getFactoryKind(target) {
|
|
33097
|
+
switch (target) {
|
|
33098
|
+
case FactoryTarget.Directive:
|
|
33099
|
+
return 'directive';
|
|
33100
|
+
case FactoryTarget.Component:
|
|
33101
|
+
return 'component';
|
|
33102
|
+
case FactoryTarget.Injectable:
|
|
33103
|
+
return 'injectable';
|
|
33104
|
+
case FactoryTarget.Pipe:
|
|
33105
|
+
return 'pipe';
|
|
33106
|
+
case FactoryTarget.NgModule:
|
|
33107
|
+
return 'NgModule';
|
|
33108
|
+
}
|
|
33109
|
+
}
|
|
33039
33110
|
/**
|
|
33040
33111
|
* Compiles a partial injectable declaration object into a full injectable definition object.
|
|
33041
33112
|
*
|
|
33042
33113
|
* @codeGenApi
|
|
33043
33114
|
*/
|
|
33044
33115
|
function ɵɵngDeclareInjectable(decl) {
|
|
33045
|
-
const compiler = getCompilerFacade();
|
|
33116
|
+
const compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'injectable', type: decl.type });
|
|
33046
33117
|
return compiler.compileInjectableDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵprov.js`, decl);
|
|
33047
33118
|
}
|
|
33048
33119
|
/**
|
|
@@ -33051,7 +33122,7 @@ function ɵɵngDeclareInjectable(decl) {
|
|
|
33051
33122
|
* @codeGenApi
|
|
33052
33123
|
*/
|
|
33053
33124
|
function ɵɵngDeclareInjector(decl) {
|
|
33054
|
-
const compiler = getCompilerFacade();
|
|
33125
|
+
const compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'NgModule', type: decl.type });
|
|
33055
33126
|
return compiler.compileInjectorDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵinj.js`, decl);
|
|
33056
33127
|
}
|
|
33057
33128
|
/**
|
|
@@ -33060,7 +33131,7 @@ function ɵɵngDeclareInjector(decl) {
|
|
|
33060
33131
|
* @codeGenApi
|
|
33061
33132
|
*/
|
|
33062
33133
|
function ɵɵngDeclareNgModule(decl) {
|
|
33063
|
-
const compiler = getCompilerFacade();
|
|
33134
|
+
const compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'NgModule', type: decl.type });
|
|
33064
33135
|
return compiler.compileNgModuleDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵmod.js`, decl);
|
|
33065
33136
|
}
|
|
33066
33137
|
/**
|
|
@@ -33069,7 +33140,7 @@ function ɵɵngDeclareNgModule(decl) {
|
|
|
33069
33140
|
* @codeGenApi
|
|
33070
33141
|
*/
|
|
33071
33142
|
function ɵɵngDeclarePipe(decl) {
|
|
33072
|
-
const compiler = getCompilerFacade();
|
|
33143
|
+
const compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'pipe', type: decl.type });
|
|
33073
33144
|
return compiler.compilePipeDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵpipe.js`, decl);
|
|
33074
33145
|
}
|
|
33075
33146
|
|