@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/bundles/core.umd.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
|
*/
|
|
@@ -358,10 +358,16 @@
|
|
|
358
358
|
r[k] = a[j];
|
|
359
359
|
return r;
|
|
360
360
|
}
|
|
361
|
-
function __spreadArray(to, from) {
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
361
|
+
function __spreadArray(to, from, pack) {
|
|
362
|
+
if (pack || arguments.length === 2)
|
|
363
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
364
|
+
if (ar || !(i in from)) {
|
|
365
|
+
if (!ar)
|
|
366
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
367
|
+
ar[i] = from[i];
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return to.concat(ar || from);
|
|
365
371
|
}
|
|
366
372
|
function __await(v) {
|
|
367
373
|
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
@@ -4334,15 +4340,38 @@
|
|
|
4334
4340
|
* Use of this source code is governed by an MIT-style license that can be
|
|
4335
4341
|
* found in the LICENSE file at https://angular.io/license
|
|
4336
4342
|
*/
|
|
4337
|
-
function getCompilerFacade() {
|
|
4343
|
+
function getCompilerFacade(request) {
|
|
4338
4344
|
var globalNg = _global['ng'];
|
|
4339
|
-
if (
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4345
|
+
if (globalNg && globalNg.ɵcompilerFacade) {
|
|
4346
|
+
return globalNg.ɵcompilerFacade;
|
|
4347
|
+
}
|
|
4348
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
4349
|
+
// Log the type as an error so that a developer can easily navigate to the type from the
|
|
4350
|
+
// console.
|
|
4351
|
+
console.error("JIT compilation failed for " + request.kind, request.type);
|
|
4352
|
+
var message = "The " + request.kind + " '" + request
|
|
4353
|
+
.type.name + "' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.\n\n";
|
|
4354
|
+
if (request.usage === 1 /* PartialDeclaration */) {
|
|
4355
|
+
message += "The " + request.kind + " is part of a library that has been partially compiled.\n";
|
|
4356
|
+
message +=
|
|
4357
|
+
"However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.\n";
|
|
4358
|
+
message += '\n';
|
|
4359
|
+
message +=
|
|
4360
|
+
"Ideally, the library is processed using the Angular Linker to become fully AOT compiled.\n";
|
|
4361
|
+
}
|
|
4362
|
+
else {
|
|
4363
|
+
message +=
|
|
4364
|
+
"JIT compilation is discouraged for production use-cases! Consider using AOT mode instead.\n";
|
|
4365
|
+
}
|
|
4366
|
+
message +=
|
|
4367
|
+
"Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server',\n";
|
|
4368
|
+
message +=
|
|
4369
|
+
"or manually provide the compiler with 'import \"@angular/compiler\";' before bootstrapping.";
|
|
4370
|
+
throw new Error(message);
|
|
4371
|
+
}
|
|
4372
|
+
else {
|
|
4373
|
+
throw new Error('JIT compiler unavailable');
|
|
4344
4374
|
}
|
|
4345
|
-
return globalNg.ɵcompilerFacade;
|
|
4346
4375
|
}
|
|
4347
4376
|
|
|
4348
4377
|
/**
|
|
@@ -6850,11 +6879,7 @@
|
|
|
6850
6879
|
};
|
|
6851
6880
|
/** @internal */
|
|
6852
6881
|
ErrorHandler.prototype._findContext = function (error) {
|
|
6853
|
-
|
|
6854
|
-
return getDebugContext(error) ? getDebugContext(error) :
|
|
6855
|
-
this._findContext(getOriginalError(error));
|
|
6856
|
-
}
|
|
6857
|
-
return null;
|
|
6882
|
+
return error ? (getDebugContext(error) || this._findContext(getOriginalError(error))) : null;
|
|
6858
6883
|
};
|
|
6859
6884
|
/** @internal */
|
|
6860
6885
|
ErrorHandler.prototype._findOriginalError = function (error) {
|
|
@@ -11723,6 +11748,7 @@
|
|
|
11723
11748
|
this.assertNotDestroyed();
|
|
11724
11749
|
// Set the injection context.
|
|
11725
11750
|
var previousInjector = setCurrentInjector(this);
|
|
11751
|
+
var previousInjectImplementation = setInjectImplementation(undefined);
|
|
11726
11752
|
try {
|
|
11727
11753
|
// Check for the SkipSelf flag.
|
|
11728
11754
|
if (!(flags & exports.InjectFlags.SkipSelf)) {
|
|
@@ -11775,7 +11801,8 @@
|
|
|
11775
11801
|
}
|
|
11776
11802
|
}
|
|
11777
11803
|
finally {
|
|
11778
|
-
// Lastly,
|
|
11804
|
+
// Lastly, restore the previous injection context.
|
|
11805
|
+
setInjectImplementation(previousInjectImplementation);
|
|
11779
11806
|
setCurrentInjector(previousInjector);
|
|
11780
11807
|
}
|
|
11781
11808
|
};
|
|
@@ -14200,7 +14227,8 @@
|
|
|
14200
14227
|
Object.defineProperty(type, NG_PROV_DEF, {
|
|
14201
14228
|
get: function () {
|
|
14202
14229
|
if (ngInjectableDef === null) {
|
|
14203
|
-
|
|
14230
|
+
var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'injectable', type: type });
|
|
14231
|
+
ngInjectableDef = compiler.compileInjectable(angularCoreDiEnv, "ng:///" + type.name + "/\u0275prov.js", getInjectableMetadata(type, meta));
|
|
14204
14232
|
}
|
|
14205
14233
|
return ngInjectableDef;
|
|
14206
14234
|
},
|
|
@@ -14211,7 +14239,7 @@
|
|
|
14211
14239
|
Object.defineProperty(type, NG_FACTORY_DEF, {
|
|
14212
14240
|
get: function () {
|
|
14213
14241
|
if (ngFactoryDef === null) {
|
|
14214
|
-
var compiler = getCompilerFacade();
|
|
14242
|
+
var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'injectable', type: type });
|
|
14215
14243
|
ngFactoryDef = compiler.compileFactory(angularCoreDiEnv, "ng:///" + type.name + "/\u0275fac.js", {
|
|
14216
14244
|
name: type.name,
|
|
14217
14245
|
type: type,
|
|
@@ -22038,7 +22066,7 @@
|
|
|
22038
22066
|
/**
|
|
22039
22067
|
* @publicApi
|
|
22040
22068
|
*/
|
|
22041
|
-
var VERSION = new Version('12.1.
|
|
22069
|
+
var VERSION = new Version('12.1.3');
|
|
22042
22070
|
|
|
22043
22071
|
/**
|
|
22044
22072
|
* @license
|
|
@@ -27637,7 +27665,8 @@
|
|
|
27637
27665
|
// go into an infinite loop before we've reached the point where we throw all the errors.
|
|
27638
27666
|
throw new Error("'" + stringifyForError(moduleType) + "' module can't import itself");
|
|
27639
27667
|
}
|
|
27640
|
-
|
|
27668
|
+
var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'NgModule', type: moduleType });
|
|
27669
|
+
ngModuleDef = compiler.compileNgModule(angularCoreEnv, "ng:///" + moduleType.name + "/\u0275mod.js", {
|
|
27641
27670
|
type: moduleType,
|
|
27642
27671
|
bootstrap: flatten(ngModule.bootstrap || EMPTY_ARRAY).map(resolveForwardRef),
|
|
27643
27672
|
declarations: declarations.map(resolveForwardRef),
|
|
@@ -27665,7 +27694,7 @@
|
|
|
27665
27694
|
Object.defineProperty(moduleType, NG_FACTORY_DEF, {
|
|
27666
27695
|
get: function () {
|
|
27667
27696
|
if (ngFactoryDef === null) {
|
|
27668
|
-
var compiler = getCompilerFacade();
|
|
27697
|
+
var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'NgModule', type: moduleType });
|
|
27669
27698
|
ngFactoryDef = compiler.compileFactory(angularCoreEnv, "ng:///" + moduleType.name + "/\u0275fac.js", {
|
|
27670
27699
|
name: moduleType.name,
|
|
27671
27700
|
type: moduleType,
|
|
@@ -27694,7 +27723,9 @@
|
|
|
27694
27723
|
(ngModule.exports || EMPTY_ARRAY).map(resolveForwardRef),
|
|
27695
27724
|
],
|
|
27696
27725
|
};
|
|
27697
|
-
|
|
27726
|
+
var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'NgModule', type: moduleType });
|
|
27727
|
+
ngInjectorDef =
|
|
27728
|
+
compiler.compileInjector(angularCoreEnv, "ng:///" + moduleType.name + "/\u0275inj.js", meta);
|
|
27698
27729
|
}
|
|
27699
27730
|
return ngInjectorDef;
|
|
27700
27731
|
},
|
|
@@ -28057,7 +28088,7 @@
|
|
|
28057
28088
|
Object.defineProperty(type, NG_COMP_DEF, {
|
|
28058
28089
|
get: function () {
|
|
28059
28090
|
if (ngComponentDef === null) {
|
|
28060
|
-
var compiler = getCompilerFacade();
|
|
28091
|
+
var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'component', type: type });
|
|
28061
28092
|
if (componentNeedsResolution(metadata)) {
|
|
28062
28093
|
var error = ["Component '" + type.name + "' is not resolved:"];
|
|
28063
28094
|
if (metadata.templateUrl) {
|
|
@@ -28148,8 +28179,9 @@
|
|
|
28148
28179
|
// that use `@Directive()` with no selector. In that case, pass empty object to the
|
|
28149
28180
|
// `directiveMetadata` function instead of null.
|
|
28150
28181
|
var meta = getDirectiveMetadata$1(type, directive || {});
|
|
28182
|
+
var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'directive', type: type });
|
|
28151
28183
|
ngDirectiveDef =
|
|
28152
|
-
|
|
28184
|
+
compiler.compileDirective(angularCoreEnv, meta.sourceMapUrl, meta.metadata);
|
|
28153
28185
|
}
|
|
28154
28186
|
return ngDirectiveDef;
|
|
28155
28187
|
},
|
|
@@ -28160,7 +28192,7 @@
|
|
|
28160
28192
|
function getDirectiveMetadata$1(type, metadata) {
|
|
28161
28193
|
var name = type && type.name;
|
|
28162
28194
|
var sourceMapUrl = "ng:///" + name + "/\u0275dir.js";
|
|
28163
|
-
var compiler = getCompilerFacade();
|
|
28195
|
+
var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'directive', type: type });
|
|
28164
28196
|
var facade = directiveMetadata(type, metadata);
|
|
28165
28197
|
facade.typeSourceSpan = compiler.createParseSourceSpan('Directive', name, sourceMapUrl);
|
|
28166
28198
|
if (facade.usesInheritance) {
|
|
@@ -28174,7 +28206,7 @@
|
|
|
28174
28206
|
get: function () {
|
|
28175
28207
|
if (ngFactoryDef === null) {
|
|
28176
28208
|
var meta = getDirectiveMetadata$1(type, metadata);
|
|
28177
|
-
var compiler = getCompilerFacade();
|
|
28209
|
+
var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'directive', type: type });
|
|
28178
28210
|
ngFactoryDef = compiler.compileFactory(angularCoreEnv, "ng:///" + type.name + "/\u0275fac.js", {
|
|
28179
28211
|
name: meta.metadata.name,
|
|
28180
28212
|
type: meta.metadata.type,
|
|
@@ -28328,7 +28360,7 @@
|
|
|
28328
28360
|
get: function () {
|
|
28329
28361
|
if (ngFactoryDef === null) {
|
|
28330
28362
|
var metadata = getPipeMetadata(type, meta);
|
|
28331
|
-
var compiler = getCompilerFacade();
|
|
28363
|
+
var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'pipe', type: metadata.type });
|
|
28332
28364
|
ngFactoryDef = compiler.compileFactory(angularCoreEnv, "ng:///" + metadata.name + "/\u0275fac.js", {
|
|
28333
28365
|
name: metadata.name,
|
|
28334
28366
|
type: metadata.type,
|
|
@@ -28346,7 +28378,9 @@
|
|
|
28346
28378
|
get: function () {
|
|
28347
28379
|
if (ngPipeDef === null) {
|
|
28348
28380
|
var metadata = getPipeMetadata(type, meta);
|
|
28349
|
-
|
|
28381
|
+
var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'pipe', type: metadata.type });
|
|
28382
|
+
ngPipeDef =
|
|
28383
|
+
compiler.compilePipe(angularCoreEnv, "ng:///" + metadata.name + "/\u0275pipe.js", metadata);
|
|
28350
28384
|
}
|
|
28351
28385
|
return ngPipeDef;
|
|
28352
28386
|
},
|
|
@@ -28577,11 +28611,11 @@
|
|
|
28577
28611
|
* through DI.
|
|
28578
28612
|
*
|
|
28579
28613
|
* ```
|
|
28580
|
-
* function
|
|
28581
|
-
* return httpClient.get("https://someUrl.com/api/user")
|
|
28614
|
+
* function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
|
|
28615
|
+
* return () => httpClient.get("https://someUrl.com/api/user")
|
|
28582
28616
|
* .pipe(
|
|
28583
28617
|
* tap(user => { ... })
|
|
28584
|
-
* )
|
|
28618
|
+
* );
|
|
28585
28619
|
* }
|
|
28586
28620
|
*
|
|
28587
28621
|
* @NgModule({
|
|
@@ -28590,7 +28624,7 @@
|
|
|
28590
28624
|
* bootstrap: [AppComponent],
|
|
28591
28625
|
* providers: [{
|
|
28592
28626
|
* provide: APP_INITIALIZER,
|
|
28593
|
-
* useFactory:
|
|
28627
|
+
* useFactory: initializeAppFactory,
|
|
28594
28628
|
* deps: [HttpClient],
|
|
28595
28629
|
* multi: true
|
|
28596
28630
|
* }]
|
|
@@ -29782,7 +29816,11 @@
|
|
|
29782
29816
|
if (compilerProviders.length === 0) {
|
|
29783
29817
|
return Promise.resolve(moduleFactory);
|
|
29784
29818
|
}
|
|
29785
|
-
var compiler = getCompilerFacade(
|
|
29819
|
+
var compiler = getCompilerFacade({
|
|
29820
|
+
usage: 0 /* Decorator */,
|
|
29821
|
+
kind: 'NgModule',
|
|
29822
|
+
type: moduleType,
|
|
29823
|
+
});
|
|
29786
29824
|
var compilerInjector = Injector.create({ providers: compilerProviders });
|
|
29787
29825
|
var resourceLoader = compilerInjector.get(compiler.ResourceLoader);
|
|
29788
29826
|
// The resource loader can also return a string while the "resolveComponentResources"
|
|
@@ -30280,20 +30318,41 @@
|
|
|
30280
30318
|
rxjs.merge(isCurrentlyStable, isStable.pipe(operators.share()));
|
|
30281
30319
|
}
|
|
30282
30320
|
/**
|
|
30283
|
-
* Bootstrap a
|
|
30321
|
+
* Bootstrap a component onto the element identified by its selector or, optionally, to a
|
|
30322
|
+
* specified element.
|
|
30284
30323
|
*
|
|
30285
30324
|
* @usageNotes
|
|
30286
30325
|
* ### Bootstrap process
|
|
30287
30326
|
*
|
|
30288
|
-
* When bootstrapping a
|
|
30289
|
-
*
|
|
30290
|
-
*
|
|
30327
|
+
* When bootstrapping a component, Angular mounts it onto a target DOM element
|
|
30328
|
+
* and kicks off automatic change detection. The target DOM element can be
|
|
30329
|
+
* provided using the `rootSelectorOrNode` argument.
|
|
30291
30330
|
*
|
|
30292
|
-
*
|
|
30293
|
-
*
|
|
30331
|
+
* If the target DOM element is not provided, Angular tries to find one on a page
|
|
30332
|
+
* using the `selector` of the component that is being bootstrapped
|
|
30333
|
+
* (first matched element is used).
|
|
30294
30334
|
*
|
|
30295
30335
|
* ### Example
|
|
30296
|
-
*
|
|
30336
|
+
*
|
|
30337
|
+
* Generally, we define the component to bootstrap in the `bootstrap` array of `NgModule`,
|
|
30338
|
+
* but it requires us to know the component while writing the application code.
|
|
30339
|
+
*
|
|
30340
|
+
* Imagine a situation where we have to wait for an API call to decide about the component to
|
|
30341
|
+
* bootstrap. We can use the `ngDoBootstrap` hook of the `NgModule` and call this method to
|
|
30342
|
+
* dynamically bootstrap a component.
|
|
30343
|
+
*
|
|
30344
|
+
* {@example core/ts/platform/platform.ts region='componentSelector'}
|
|
30345
|
+
*
|
|
30346
|
+
* Optionally, a component can be mounted onto a DOM element that does not match the
|
|
30347
|
+
* selector of the bootstrapped component.
|
|
30348
|
+
*
|
|
30349
|
+
* In the following example, we are providing a CSS selector to match the target element.
|
|
30350
|
+
*
|
|
30351
|
+
* {@example core/ts/platform/platform.ts region='cssSelector'}
|
|
30352
|
+
*
|
|
30353
|
+
* While in this example, we are providing reference to a DOM node.
|
|
30354
|
+
*
|
|
30355
|
+
* {@example core/ts/platform/platform.ts region='domNode'}
|
|
30297
30356
|
*/
|
|
30298
30357
|
ApplicationRef.prototype.bootstrap = function (componentOrFactory, rootSelectorOrNode) {
|
|
30299
30358
|
var _this = this;
|
|
@@ -33880,7 +33939,7 @@
|
|
|
33880
33939
|
* @codeGenApi
|
|
33881
33940
|
*/
|
|
33882
33941
|
function ɵɵngDeclareDirective(decl) {
|
|
33883
|
-
var compiler = getCompilerFacade();
|
|
33942
|
+
var compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'directive', type: decl.type });
|
|
33884
33943
|
return compiler.compileDirectiveDeclaration(angularCoreEnv, "ng:///" + decl.type.name + "/\u0275fac.js", decl);
|
|
33885
33944
|
}
|
|
33886
33945
|
/**
|
|
@@ -33898,7 +33957,7 @@
|
|
|
33898
33957
|
* @codeGenApi
|
|
33899
33958
|
*/
|
|
33900
33959
|
function ɵɵngDeclareComponent(decl) {
|
|
33901
|
-
var compiler = getCompilerFacade();
|
|
33960
|
+
var compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'component', type: decl.type });
|
|
33902
33961
|
return compiler.compileComponentDeclaration(angularCoreEnv, "ng:///" + decl.type.name + "/\u0275cmp.js", decl);
|
|
33903
33962
|
}
|
|
33904
33963
|
/**
|
|
@@ -33907,16 +33966,34 @@
|
|
|
33907
33966
|
* @codeGenApi
|
|
33908
33967
|
*/
|
|
33909
33968
|
function ɵɵngDeclareFactory(decl) {
|
|
33910
|
-
var compiler = getCompilerFacade(
|
|
33969
|
+
var compiler = getCompilerFacade({
|
|
33970
|
+
usage: 1 /* PartialDeclaration */,
|
|
33971
|
+
kind: getFactoryKind(decl.target),
|
|
33972
|
+
type: decl.type
|
|
33973
|
+
});
|
|
33911
33974
|
return compiler.compileFactoryDeclaration(angularCoreEnv, "ng:///" + decl.type.name + "/\u0275fac.js", decl);
|
|
33912
33975
|
}
|
|
33976
|
+
function getFactoryKind(target) {
|
|
33977
|
+
switch (target) {
|
|
33978
|
+
case exports.ɵɵFactoryTarget.Directive:
|
|
33979
|
+
return 'directive';
|
|
33980
|
+
case exports.ɵɵFactoryTarget.Component:
|
|
33981
|
+
return 'component';
|
|
33982
|
+
case exports.ɵɵFactoryTarget.Injectable:
|
|
33983
|
+
return 'injectable';
|
|
33984
|
+
case exports.ɵɵFactoryTarget.Pipe:
|
|
33985
|
+
return 'pipe';
|
|
33986
|
+
case exports.ɵɵFactoryTarget.NgModule:
|
|
33987
|
+
return 'NgModule';
|
|
33988
|
+
}
|
|
33989
|
+
}
|
|
33913
33990
|
/**
|
|
33914
33991
|
* Compiles a partial injectable declaration object into a full injectable definition object.
|
|
33915
33992
|
*
|
|
33916
33993
|
* @codeGenApi
|
|
33917
33994
|
*/
|
|
33918
33995
|
function ɵɵngDeclareInjectable(decl) {
|
|
33919
|
-
var compiler = getCompilerFacade();
|
|
33996
|
+
var compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'injectable', type: decl.type });
|
|
33920
33997
|
return compiler.compileInjectableDeclaration(angularCoreEnv, "ng:///" + decl.type.name + "/\u0275prov.js", decl);
|
|
33921
33998
|
}
|
|
33922
33999
|
/**
|
|
@@ -33925,7 +34002,7 @@
|
|
|
33925
34002
|
* @codeGenApi
|
|
33926
34003
|
*/
|
|
33927
34004
|
function ɵɵngDeclareInjector(decl) {
|
|
33928
|
-
var compiler = getCompilerFacade();
|
|
34005
|
+
var compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'NgModule', type: decl.type });
|
|
33929
34006
|
return compiler.compileInjectorDeclaration(angularCoreEnv, "ng:///" + decl.type.name + "/\u0275inj.js", decl);
|
|
33930
34007
|
}
|
|
33931
34008
|
/**
|
|
@@ -33934,7 +34011,7 @@
|
|
|
33934
34011
|
* @codeGenApi
|
|
33935
34012
|
*/
|
|
33936
34013
|
function ɵɵngDeclareNgModule(decl) {
|
|
33937
|
-
var compiler = getCompilerFacade();
|
|
34014
|
+
var compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'NgModule', type: decl.type });
|
|
33938
34015
|
return compiler.compileNgModuleDeclaration(angularCoreEnv, "ng:///" + decl.type.name + "/\u0275mod.js", decl);
|
|
33939
34016
|
}
|
|
33940
34017
|
/**
|
|
@@ -33943,7 +34020,7 @@
|
|
|
33943
34020
|
* @codeGenApi
|
|
33944
34021
|
*/
|
|
33945
34022
|
function ɵɵngDeclarePipe(decl) {
|
|
33946
|
-
var compiler = getCompilerFacade();
|
|
34023
|
+
var compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'pipe', type: decl.type });
|
|
33947
34024
|
return compiler.compilePipeDeclaration(angularCoreEnv, "ng:///" + decl.type.name + "/\u0275pipe.js", decl);
|
|
33948
34025
|
}
|
|
33949
34026
|
|