@angular/core 8.0.0 → 8.1.0-beta.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/bundles/core-testing.umd.js +35 -9
- package/bundles/core-testing.umd.js.map +1 -1
- package/bundles/core-testing.umd.min.js +10 -10
- package/bundles/core-testing.umd.min.js.map +1 -1
- package/bundles/core.umd.js +11356 -9352
- package/bundles/core.umd.js.map +1 -1
- package/bundles/core.umd.min.js +201 -139
- package/bundles/core.umd.min.js.map +1 -1
- package/core.d.ts +1302 -404
- package/core.metadata.json +1 -1
- package/esm2015/core.js +2 -3
- package/esm2015/index.js +2 -2
- package/esm2015/public_api.js +2 -2
- package/esm2015/src/application_ref.js +7 -1
- package/esm2015/src/codegen_private_exports.js +2 -2
- package/esm2015/src/compiler/compiler_facade_interface.js +1 -1
- package/esm2015/src/core.js +4 -4
- package/esm2015/src/core_private_export.js +3 -1
- package/esm2015/src/core_render3_private_export.js +5 -3
- package/esm2015/src/debug/debug_node.js +4 -4
- package/esm2015/src/di/index.js +3 -3
- package/esm2015/src/di/injector.js +24 -96
- package/esm2015/src/di/injector_compatibility.js +103 -6
- package/esm2015/src/di/interface/defs.js +24 -3
- package/esm2015/src/di/r3_injector.js +82 -49
- package/esm2015/src/di/reflective_injector.js +3 -2
- package/esm2015/src/di.js +1 -1
- package/esm2015/src/i18n/locale_data.js +61 -0
- package/esm2015/src/i18n/locale_data_api.js +53 -0
- package/esm2015/src/i18n/locale_en.js +51 -0
- package/esm2015/src/i18n/localization.js +37 -0
- package/esm2015/src/linker/ng_module_factory_loader.js +4 -52
- package/esm2015/src/linker/ng_module_factory_registration.js +83 -0
- package/esm2015/src/metadata/ng_module.js +6 -1
- package/esm2015/src/metadata/resource_loading.js +2 -2
- package/esm2015/src/reflection/reflection_capabilities.js +14 -3
- package/esm2015/src/render3/assert.js +3 -2
- package/esm2015/src/render3/component.js +11 -5
- package/esm2015/src/render3/debug.js +23 -15
- package/esm2015/src/render3/definition.js +12 -2
- package/esm2015/src/render3/errors.js +29 -1
- package/esm2015/src/render3/features/inherit_definition_feature.js +51 -37
- package/esm2015/src/render3/fields.js +3 -1
- package/esm2015/src/render3/i18n.js +76 -465
- package/esm2015/src/render3/index.js +3 -3
- package/esm2015/src/render3/instructions/all.js +9 -4
- package/esm2015/src/render3/instructions/attribute.js +28 -0
- package/esm2015/src/render3/instructions/attribute_interpolation.js +376 -0
- package/esm2015/src/render3/instructions/container.js +17 -16
- package/esm2015/src/render3/instructions/element.js +57 -35
- package/esm2015/src/render3/instructions/element_container.js +9 -8
- package/esm2015/src/render3/instructions/embedded_view.js +9 -12
- package/esm2015/src/render3/instructions/interpolation.js +375 -0
- package/esm2015/src/render3/instructions/listener.js +3 -2
- package/esm2015/src/render3/instructions/projection.js +6 -6
- package/esm2015/src/render3/instructions/property.js +10 -4
- package/esm2015/src/render3/instructions/property_interpolation.js +49 -382
- package/esm2015/src/render3/instructions/shared.js +82 -118
- package/esm2015/src/render3/instructions/styling.js +189 -236
- package/esm2015/src/render3/instructions/text.js +8 -7
- package/esm2015/src/render3/instructions/text_interpolation.js +357 -0
- package/esm2015/src/render3/interfaces/container.js +9 -5
- package/esm2015/src/render3/interfaces/definition.js +12 -6
- package/esm2015/src/render3/interfaces/node.js +20 -8
- package/esm2015/src/render3/interfaces/styling.js +16 -15
- package/esm2015/src/render3/interfaces/view.js +2 -2
- package/esm2015/src/render3/jit/directive.js +14 -5
- package/esm2015/src/render3/jit/environment.js +30 -15
- package/esm2015/src/render3/jit/module.js +38 -19
- package/esm2015/src/render3/ng_module_ref.js +39 -3
- package/esm2015/src/render3/node_manipulation.js +45 -43
- package/esm2015/src/render3/node_selector_matcher.js +14 -13
- package/esm2015/src/render3/query.js +77 -61
- package/esm2015/src/render3/state.js +33 -6
- package/esm2015/src/render3/styling/class_and_style_bindings.js +91 -79
- package/esm2015/src/render3/styling/host_instructions_queue.js +8 -5
- package/esm2015/src/render3/styling/shared.js +2 -2
- package/esm2015/src/render3/styling/util.js +2 -2
- package/esm2015/src/render3/styling_next/bindings.js +602 -0
- package/esm2015/src/render3/styling_next/instructions.js +366 -0
- package/esm2015/src/render3/styling_next/interfaces.js +374 -0
- package/esm2015/src/render3/styling_next/map_based_bindings.js +408 -0
- package/esm2015/src/render3/styling_next/state.js +51 -0
- package/esm2015/src/render3/styling_next/styling_debug.js +291 -0
- package/esm2015/src/render3/styling_next/util.js +259 -0
- package/esm2015/src/render3/util/attrs_utils.js +4 -3
- package/esm2015/src/render3/util/debug_utils.js +18 -0
- package/esm2015/src/render3/util/view_traversal_utils.js +2 -2
- package/esm2015/src/render3/view_engine_compatibility.js +24 -10
- package/esm2015/src/sanitization/sanitization.js +17 -7
- package/esm2015/src/sanitization/style_sanitizer.js +11 -1
- package/esm2015/src/util/ng_dev_mode.js +7 -3
- package/esm2015/src/version.js +1 -1
- package/esm2015/src/view/ng_module.js +3 -3
- package/esm2015/src/view/util.js +2 -2
- package/esm2015/testing/src/r3_test_bed_compiler.js +44 -12
- package/esm5/core.js +2 -3
- package/esm5/src/application_ref.js +6 -1
- package/esm5/src/codegen_private_exports.js +2 -2
- package/esm5/src/compiler/compiler_facade_interface.js +1 -1
- package/esm5/src/core_private_export.js +3 -1
- package/esm5/src/core_render3_private_export.js +5 -3
- package/esm5/src/debug/debug_node.js +4 -4
- package/esm5/src/di/index.js +3 -3
- package/esm5/src/di/injector.js +14 -74
- package/esm5/src/di/injector_compatibility.js +77 -6
- package/esm5/src/di/interface/defs.js +24 -3
- package/esm5/src/di/r3_injector.js +60 -37
- package/esm5/src/di/reflective_injector.js +3 -2
- package/esm5/src/i18n/locale_data.js +38 -0
- package/esm5/src/i18n/locale_data_api.js +46 -0
- package/esm5/src/i18n/locale_en.js +39 -0
- package/esm5/src/i18n/localization.js +29 -0
- package/esm5/src/linker/ng_module_factory_loader.js +4 -32
- package/esm5/src/linker/ng_module_factory_registration.js +50 -0
- package/esm5/src/metadata/ng_module.js +1 -1
- package/esm5/src/metadata/resource_loading.js +2 -2
- package/esm5/src/reflection/reflection_capabilities.js +14 -3
- package/esm5/src/render3/assert.js +2 -1
- package/esm5/src/render3/component.js +10 -4
- package/esm5/src/render3/debug.js +17 -10
- package/esm5/src/render3/definition.js +8 -2
- package/esm5/src/render3/errors.js +14 -1
- package/esm5/src/render3/features/inherit_definition_feature.js +41 -36
- package/esm5/src/render3/fields.js +2 -1
- package/esm5/src/render3/i18n.js +67 -437
- package/esm5/src/render3/index.js +3 -3
- package/esm5/src/render3/instructions/all.js +6 -1
- package/esm5/src/render3/instructions/attribute.js +22 -0
- package/esm5/src/render3/instructions/attribute_interpolation.js +346 -0
- package/esm5/src/render3/instructions/container.js +16 -15
- package/esm5/src/render3/instructions/element.js +43 -32
- package/esm5/src/render3/instructions/element_container.js +9 -8
- package/esm5/src/render3/instructions/embedded_view.js +8 -11
- package/esm5/src/render3/instructions/interpolation.js +243 -0
- package/esm5/src/render3/instructions/listener.js +3 -2
- package/esm5/src/render3/instructions/projection.js +6 -6
- package/esm5/src/render3/instructions/property.js +10 -4
- package/esm5/src/render3/instructions/property_interpolation.js +40 -254
- package/esm5/src/render3/instructions/shared.js +70 -105
- package/esm5/src/render3/instructions/styling.js +167 -209
- package/esm5/src/render3/instructions/text.js +8 -7
- package/esm5/src/render3/instructions/text_interpolation.js +264 -0
- package/esm5/src/render3/interfaces/container.js +8 -2
- package/esm5/src/render3/interfaces/definition.js +1 -1
- package/esm5/src/render3/interfaces/node.js +1 -8
- package/esm5/src/render3/interfaces/styling.js +2 -2
- package/esm5/src/render3/interfaces/view.js +1 -1
- package/esm5/src/render3/jit/directive.js +12 -5
- package/esm5/src/render3/jit/environment.js +30 -15
- package/esm5/src/render3/jit/module.js +23 -18
- package/esm5/src/render3/ng_module_ref.js +37 -3
- package/esm5/src/render3/node_manipulation.js +39 -38
- package/esm5/src/render3/node_selector_matcher.js +14 -13
- package/esm5/src/render3/query.js +75 -53
- package/esm5/src/render3/state.js +29 -5
- package/esm5/src/render3/styling/class_and_style_bindings.js +79 -65
- package/esm5/src/render3/styling/host_instructions_queue.js +6 -3
- package/esm5/src/render3/styling/shared.js +2 -2
- package/esm5/src/render3/styling/util.js +2 -2
- package/esm5/src/render3/styling_next/bindings.js +446 -0
- package/esm5/src/render3/styling_next/instructions.js +277 -0
- package/esm5/src/render3/styling_next/interfaces.js +1 -0
- package/esm5/src/render3/styling_next/map_based_bindings.js +324 -0
- package/esm5/src/render3/styling_next/state.js +23 -0
- package/esm5/src/render3/styling_next/styling_debug.js +130 -0
- package/esm5/src/render3/styling_next/util.js +147 -0
- package/esm5/src/render3/util/attrs_utils.js +4 -3
- package/esm5/src/render3/util/debug_utils.js +11 -0
- package/esm5/src/render3/util/view_traversal_utils.js +2 -2
- package/esm5/src/render3/view_engine_compatibility.js +23 -10
- package/esm5/src/sanitization/sanitization.js +14 -6
- package/esm5/src/sanitization/style_sanitizer.js +1 -1
- package/esm5/src/util/ng_dev_mode.js +7 -3
- package/esm5/src/version.js +1 -1
- package/esm5/src/view/ng_module.js +3 -3
- package/esm5/src/view/util.js +2 -2
- package/esm5/testing/src/r3_test_bed_compiler.js +37 -11
- package/fesm2015/core.js +13481 -10733
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/testing.js +43 -11
- package/fesm2015/testing.js.map +1 -1
- package/fesm5/core.js +11255 -9269
- package/fesm5/core.js.map +1 -1
- package/fesm5/testing.js +36 -10
- package/fesm5/testing.js.map +1 -1
- package/package.json +1 -1
- package/schematics/migrations/template-var-assignment/index.js +2 -2
- package/src/r3_symbols.d.ts +5 -1
- package/testing/testing.d.ts +1 -1
- package/testing.d.ts +1 -1
package/fesm5/testing.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v8.0.0
|
|
2
|
+
* @license Angular v8.1.0-beta.0
|
|
3
3
|
* (c) 2010-2019 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { RendererFactory2, getDebugNode, InjectionToken, ɵstringify, ɵReflectionCapabilities, Directive, Component, Pipe, NgModule, COMPILER_OPTIONS, ɵcompileNgModuleDefs, ɵNgModuleFactory, ɵgetInjectableDef, ɵNG_COMPONENT_DEF, ɵRender3NgModuleRef, ApplicationInitStatus, ɵRender3ComponentFactory, ɵcompileComponent, ɵNG_DIRECTIVE_DEF, ɵcompileDirective, ɵNG_PIPE_DEF, ɵcompilePipe, ɵpatchComponentDefWithScope, ɵNG_INJECTOR_DEF, ɵNG_MODULE_DEF, NgZone, Compiler, ɵtransitiveScopesFor, ModuleWithComponentFactories, ɵresetCompiledComponents, Injector, InjectFlags, ɵflushModuleScopingQueueAsMuchAsPossible, Injectable, ɵclearOverrides, ɵoverrideComponentView, ɵAPP_ROOT, ɵoverrideProvider, ɵivyEnabled, Optional, SkipSelf } from '@angular/core';
|
|
7
|
+
import { RendererFactory2, getDebugNode, InjectionToken, ɵstringify, ɵReflectionCapabilities, Directive, Component, Pipe, NgModule, COMPILER_OPTIONS, ɵcompileNgModuleDefs, ɵNgModuleFactory, ɵgetInjectableDef, ɵNG_COMPONENT_DEF, ɵRender3NgModuleRef, LOCALE_ID, ɵDEFAULT_LOCALE_ID, ɵsetLocaleId, ApplicationInitStatus, ɵRender3ComponentFactory, ɵcompileComponent, ɵNG_DIRECTIVE_DEF, ɵcompileDirective, ɵNG_PIPE_DEF, ɵcompilePipe, ɵpatchComponentDefWithScope, ɵNG_INJECTOR_DEF, ɵNG_MODULE_DEF, NgZone, Compiler, ɵtransitiveScopesFor, ModuleWithComponentFactories, ɵresetCompiledComponents, Injector, InjectFlags, ɵflushModuleScopingQueueAsMuchAsPossible, Injectable, ɵclearOverrides, ɵoverrideComponentView, ɵAPP_ROOT, ɵoverrideProvider, ɵivyEnabled, Optional, SkipSelf } from '@angular/core';
|
|
8
8
|
import { __read, __extends, __spread, __awaiter, __generator, __values, __decorate } from 'tslib';
|
|
9
9
|
import { ResourceLoader } from '@angular/compiler';
|
|
10
10
|
|
|
@@ -995,7 +995,15 @@ var NgModuleResolver = /** @class */ (function (_super) {
|
|
|
995
995
|
* Use of this source code is governed by an MIT-style license that can be
|
|
996
996
|
* found in the LICENSE file at https://angular.io/license
|
|
997
997
|
*/
|
|
998
|
-
var
|
|
998
|
+
var TestingModuleOverride;
|
|
999
|
+
(function (TestingModuleOverride) {
|
|
1000
|
+
TestingModuleOverride[TestingModuleOverride["DECLARATION"] = 0] = "DECLARATION";
|
|
1001
|
+
TestingModuleOverride[TestingModuleOverride["OVERRIDE_TEMPLATE"] = 1] = "OVERRIDE_TEMPLATE";
|
|
1002
|
+
})(TestingModuleOverride || (TestingModuleOverride = {}));
|
|
1003
|
+
function isTestingModuleOverride(value) {
|
|
1004
|
+
return value === TestingModuleOverride.DECLARATION ||
|
|
1005
|
+
value === TestingModuleOverride.OVERRIDE_TEMPLATE;
|
|
1006
|
+
}
|
|
999
1007
|
var R3TestBedCompiler = /** @class */ (function () {
|
|
1000
1008
|
function R3TestBedCompiler(platform, additionalModuleTypes) {
|
|
1001
1009
|
this.platform = platform;
|
|
@@ -1048,7 +1056,7 @@ var R3TestBedCompiler = /** @class */ (function () {
|
|
|
1048
1056
|
var _a, _b, _c, _d;
|
|
1049
1057
|
// Enqueue any compilation tasks for the directly declared component.
|
|
1050
1058
|
if (moduleDef.declarations !== undefined) {
|
|
1051
|
-
this.queueTypeArray(moduleDef.declarations,
|
|
1059
|
+
this.queueTypeArray(moduleDef.declarations, TestingModuleOverride.DECLARATION);
|
|
1052
1060
|
(_a = this.declarations).push.apply(_a, __spread(moduleDef.declarations));
|
|
1053
1061
|
}
|
|
1054
1062
|
// Enqueue any compilation tasks for imported modules.
|
|
@@ -1126,7 +1134,7 @@ var R3TestBedCompiler = /** @class */ (function () {
|
|
|
1126
1134
|
this.existingComponentStyles.set(type, def.styles);
|
|
1127
1135
|
}
|
|
1128
1136
|
// Set the component's scope to be the testing module.
|
|
1129
|
-
this.componentToModuleScope.set(type,
|
|
1137
|
+
this.componentToModuleScope.set(type, TestingModuleOverride.OVERRIDE_TEMPLATE);
|
|
1130
1138
|
};
|
|
1131
1139
|
R3TestBedCompiler.prototype.compileComponents = function () {
|
|
1132
1140
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -1168,6 +1176,9 @@ var R3TestBedCompiler = /** @class */ (function () {
|
|
|
1168
1176
|
this.componentToModuleScope.clear();
|
|
1169
1177
|
var parentInjector = this.platform.injector;
|
|
1170
1178
|
this.testModuleRef = new ɵRender3NgModuleRef(this.testModuleType, parentInjector);
|
|
1179
|
+
// Set the locale ID, it can be overridden for the tests
|
|
1180
|
+
var localeId = this.testModuleRef.injector.get(LOCALE_ID, ɵDEFAULT_LOCALE_ID);
|
|
1181
|
+
ɵsetLocaleId(localeId);
|
|
1171
1182
|
// ApplicationInitStatus.runInitializers() is marked @internal to core.
|
|
1172
1183
|
// Cast it to any before accessing it.
|
|
1173
1184
|
this.testModuleRef.injector.get(ApplicationInitStatus).runInitializers();
|
|
@@ -1248,7 +1259,7 @@ var R3TestBedCompiler = /** @class */ (function () {
|
|
|
1248
1259
|
var moduleToScope = new Map();
|
|
1249
1260
|
var getScopeOfModule = function (moduleType) {
|
|
1250
1261
|
if (!moduleToScope.has(moduleType)) {
|
|
1251
|
-
var realType = moduleType
|
|
1262
|
+
var realType = isTestingModuleOverride(moduleType) ? _this.testModuleType : moduleType;
|
|
1252
1263
|
moduleToScope.set(moduleType, ɵtransitiveScopesFor(realType));
|
|
1253
1264
|
}
|
|
1254
1265
|
return moduleToScope.get(moduleType);
|
|
@@ -1351,9 +1362,22 @@ var R3TestBedCompiler = /** @class */ (function () {
|
|
|
1351
1362
|
}
|
|
1352
1363
|
this.seenComponents.add(type);
|
|
1353
1364
|
// Keep track of the module which declares this component, so later the component's scope
|
|
1354
|
-
// can be set correctly.
|
|
1355
|
-
//
|
|
1356
|
-
|
|
1365
|
+
// can be set correctly. If the component has already been recorded here, then one of several
|
|
1366
|
+
// cases is true:
|
|
1367
|
+
// * the module containing the component was imported multiple times (common).
|
|
1368
|
+
// * the component is declared in multiple modules (which is an error).
|
|
1369
|
+
// * the component was in 'declarations' of the testing module, and also in an imported module
|
|
1370
|
+
// in which case the module scope will be TestingModuleOverride.DECLARATION.
|
|
1371
|
+
// * overrideTemplateUsingTestingModule was called for the component in which case the module
|
|
1372
|
+
// scope will be TestingModuleOverride.OVERRIDE_TEMPLATE.
|
|
1373
|
+
//
|
|
1374
|
+
// If the component was previously in the testing module's 'declarations' (meaning the
|
|
1375
|
+
// current value is TestingModuleOverride.DECLARATION), then `moduleType` is the component's
|
|
1376
|
+
// real module, which was imported. This pattern is understood to mean that the component
|
|
1377
|
+
// should use its original scope, but that the testing module should also contain the
|
|
1378
|
+
// component in its scope.
|
|
1379
|
+
if (!this.componentToModuleScope.has(type) ||
|
|
1380
|
+
this.componentToModuleScope.get(type) === TestingModuleOverride.DECLARATION) {
|
|
1357
1381
|
this.componentToModuleScope.set(type, moduleType);
|
|
1358
1382
|
}
|
|
1359
1383
|
return;
|
|
@@ -1465,6 +1489,8 @@ var R3TestBedCompiler = /** @class */ (function () {
|
|
|
1465
1489
|
this.initialNgDefs.clear();
|
|
1466
1490
|
this.moduleProvidersOverridden.clear();
|
|
1467
1491
|
this.restoreComponentResolutionQueue();
|
|
1492
|
+
// Restore the locale ID to the default value, this shouldn't be necessary but we never know
|
|
1493
|
+
ɵsetLocaleId(ɵDEFAULT_LOCALE_ID);
|
|
1468
1494
|
};
|
|
1469
1495
|
R3TestBedCompiler.prototype.compileTestModule = function () {
|
|
1470
1496
|
var _this = this;
|
|
@@ -1488,7 +1514,7 @@ var R3TestBedCompiler = /** @class */ (function () {
|
|
|
1488
1514
|
imports: imports,
|
|
1489
1515
|
schemas: this.schemas,
|
|
1490
1516
|
providers: providers,
|
|
1491
|
-
});
|
|
1517
|
+
}, /* allowDuplicateDeclarationsInRoot */ true);
|
|
1492
1518
|
// clang-format on
|
|
1493
1519
|
this.applyProviderOverridesToModule(this.testModuleType);
|
|
1494
1520
|
};
|