@angular/core 6.0.3 → 6.0.7
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 +61 -237
- package/bundles/core-testing.umd.js.map +1 -1
- package/bundles/core-testing.umd.min.js +11 -4
- package/bundles/core-testing.umd.min.js.map +1 -1
- package/bundles/core.umd.js +591 -2007
- package/bundles/core.umd.js.map +1 -1
- package/bundles/core.umd.min.js +4 -32
- package/bundles/core.umd.min.js.map +1 -1
- package/core.metadata.json +1 -1
- package/esm2015/core.externs.js +3 -3
- package/esm2015/src/application_init.js +2 -9
- package/esm2015/src/application_module.js +1 -10
- package/esm2015/src/application_ref.js +15 -30
- package/esm2015/src/change_detection/change_detector_ref.js +7 -5
- package/esm2015/src/change_detection/differs/iterable_differs.js +4 -3
- package/esm2015/src/change_detection/differs/keyvalue_differs.js +4 -3
- package/esm2015/src/change_detection/pipe_transform.js +3 -6
- package/esm2015/src/console.js +0 -11
- package/esm2015/src/di/forward_ref.js +8 -6
- package/esm2015/src/di/injectable.js +1 -4
- package/esm2015/src/di/injection_token.js +6 -8
- package/esm2015/src/di/injector.js +5 -10
- package/esm2015/src/di/metadata.js +1 -16
- package/esm2015/src/di/provider.js +47 -138
- package/esm2015/src/di/reflective_errors.js +14 -7
- package/esm2015/src/di/reflective_injector.js +22 -24
- package/esm2015/src/di/reflective_provider.js +11 -12
- package/esm2015/src/error_handler.js +2 -5
- package/esm2015/src/event_emitter.js +6 -3
- package/esm2015/src/i18n/tokens.js +7 -4
- package/esm2015/src/linker/compiler.js +1 -12
- package/esm2015/src/linker/query_list.js +4 -4
- package/esm2015/src/linker/system_js_ng_module_factory_loader.js +3 -10
- package/esm2015/src/linker/view_ref.js +10 -7
- package/esm2015/src/metadata/di.js +10 -16
- package/esm2015/src/metadata/directives.js +111 -33
- package/esm2015/src/metadata/lifecycle_hooks.js +9 -9
- package/esm2015/src/metadata/ng_module.js +19 -11
- package/esm2015/src/render3/node_manipulation.js +2 -3
- package/esm2015/src/render3/view_ref.js +7 -3
- package/esm2015/src/testability/testability.js +2 -16
- package/esm2015/src/version.js +1 -1
- package/esm2015/src/view/ng_module.js +4 -1
- package/esm2015/src/zone/ng_zone.js +2 -1
- package/esm2015/testing/src/fake_async.js +5 -3
- package/esm2015/testing/src/fake_async_fallback.js +5 -3
- package/esm2015/testing/src/logger.js +0 -7
- package/esm2015/testing/src/metadata_override.js +1 -1
- package/esm2015/testing/src/ng_zone_mock.js +0 -7
- package/esm2015/testing/src/test_bed.js +1 -34
- package/esm2015/testing/src/test_compiler.js +1 -12
- package/esm5/index.js +5 -1
- package/esm5/public_api.js +6 -1
- package/esm5/src/application_init.js +3 -5
- package/esm5/src/application_module.js +2 -2
- package/esm5/src/application_ref.js +35 -211
- package/esm5/src/application_tokens.js +1 -1
- package/esm5/src/change_detection/change_detection.js +1 -1
- package/esm5/src/change_detection/change_detection_util.js +7 -72
- package/esm5/src/change_detection/change_detector_ref.js +1 -1
- package/esm5/src/change_detection/constants.js +1 -24
- package/esm5/src/change_detection/differs/default_iterable_differ.js +26 -209
- package/esm5/src/change_detection/differs/default_keyvalue_differ.js +7 -38
- package/esm5/src/change_detection/differs/iterable_differs.js +5 -42
- package/esm5/src/change_detection/differs/keyvalue_differs.js +6 -51
- package/esm5/src/change_detection/pipe_transform.js +1 -1
- package/esm5/src/change_detection.js +6 -1
- package/esm5/src/codegen_private_exports.js +1 -1
- package/esm5/src/console.js +2 -7
- package/esm5/src/core.js +6 -1
- package/esm5/src/core_private_export.js +1 -1
- package/esm5/src/core_render3_private_export.js +2 -1
- package/esm5/src/debug/debug_node.js +3 -15
- package/esm5/src/di/defs.js +1 -1
- package/esm5/src/di/forward_ref.js +7 -6
- package/esm5/src/di/injectable.js +2 -3
- package/esm5/src/di/injection_token.js +5 -83
- package/esm5/src/di/injector.js +13 -27
- package/esm5/src/di/metadata.js +1 -6
- package/esm5/src/di/provider.js +1 -1
- package/esm5/src/di/r3_injector.js +13 -39
- package/esm5/src/di/reflective_errors.js +14 -7
- package/esm5/src/di/reflective_injector.js +19 -265
- package/esm5/src/di/reflective_key.js +4 -45
- package/esm5/src/di/reflective_provider.js +17 -35
- package/esm5/src/di/scope.js +1 -1
- package/esm5/src/di.js +6 -1
- package/esm5/src/error_handler.js +7 -66
- package/esm5/src/errors.js +1 -1
- package/esm5/src/event_emitter.js +4 -95
- package/esm5/src/i18n/tokens.js +9 -49
- package/esm5/src/linker/compiler.js +9 -69
- package/esm5/src/linker/component_factory.js +2 -18
- package/esm5/src/linker/component_factory_resolver.js +1 -1
- package/esm5/src/linker/element_ref.js +2 -32
- package/esm5/src/linker/ng_module_factory.js +3 -25
- package/esm5/src/linker/ng_module_factory_loader.js +2 -10
- package/esm5/src/linker/query_list.js +12 -112
- package/esm5/src/linker/system_js_ng_module_factory_loader.js +4 -16
- package/esm5/src/linker/template_ref.js +2 -26
- package/esm5/src/linker/view_container_ref.js +2 -38
- package/esm5/src/linker/view_ref.js +10 -115
- package/esm5/src/linker.js +2 -1
- package/esm5/src/metadata/di.js +7 -25
- package/esm5/src/metadata/directives.js +111 -20
- package/esm5/src/metadata/lifecycle_hooks.js +1 -1
- package/esm5/src/metadata/ng_module.js +14 -9
- package/esm5/src/metadata/view.js +1 -20
- package/esm5/src/metadata.js +1 -1
- package/esm5/src/platform_core_providers.js +1 -1
- package/esm5/src/profile/profile.js +1 -1
- package/esm5/src/profile/wtf_impl.js +1 -1
- package/esm5/src/reflection/platform_reflection_capabilities.js +1 -1
- package/esm5/src/reflection/reflection.js +1 -1
- package/esm5/src/reflection/reflection_capabilities.js +3 -8
- package/esm5/src/reflection/reflector.js +2 -10
- package/esm5/src/reflection/types.js +1 -1
- package/esm5/src/render/api.js +7 -71
- package/esm5/src/render.js +2 -1
- package/esm5/src/render3/assert.js +1 -1
- package/esm5/src/render3/component.js +6 -5
- package/esm5/src/render3/definition.js +6 -8
- package/esm5/src/render3/di.js +9 -14
- package/esm5/src/render3/errors.js +1 -1
- package/esm5/src/render3/hooks.js +2 -2
- package/esm5/src/render3/index.js +11 -1
- package/esm5/src/render3/instructions.js +52 -38
- package/esm5/src/render3/interfaces/container.js +1 -1
- package/esm5/src/render3/interfaces/definition.js +1 -1
- package/esm5/src/render3/interfaces/injector.js +1 -1
- package/esm5/src/render3/interfaces/node.js +1 -1
- package/esm5/src/render3/interfaces/projection.js +1 -1
- package/esm5/src/render3/interfaces/query.js +1 -1
- package/esm5/src/render3/interfaces/renderer.js +1 -3
- package/esm5/src/render3/interfaces/view.js +1 -1
- package/esm5/src/render3/ng_dev_mode.js +1 -1
- package/esm5/src/render3/node_assert.js +1 -1
- package/esm5/src/render3/node_manipulation.js +12 -15
- package/esm5/src/render3/node_selector_matcher.js +2 -2
- package/esm5/src/render3/pipe.js +1 -1
- package/esm5/src/render3/pure_function.js +1 -1
- package/esm5/src/render3/query.js +11 -59
- package/esm5/src/render3/util.js +1 -1
- package/esm5/src/render3/view_ref.js +15 -345
- package/esm5/src/sanitization/html_sanitizer.js +8 -12
- package/esm5/src/sanitization/inert_body.js +8 -72
- package/esm5/src/sanitization/sanitization.js +1 -1
- package/esm5/src/sanitization/security.js +2 -37
- package/esm5/src/sanitization/style_sanitizer.js +1 -1
- package/esm5/src/sanitization/url_sanitizer.js +1 -1
- package/esm5/src/testability/testability.js +21 -143
- package/esm5/src/type.js +1 -1
- package/esm5/src/util/decorators.js +1 -1
- package/esm5/src/util/lang.js +1 -1
- package/esm5/src/util/property.js +1 -1
- package/esm5/src/util.js +6 -1
- package/esm5/src/version.js +3 -13
- package/esm5/src/view/element.js +7 -7
- package/esm5/src/view/entrypoint.js +1 -1
- package/esm5/src/view/errors.js +1 -1
- package/esm5/src/view/index.js +1 -1
- package/esm5/src/view/ng_content.js +1 -1
- package/esm5/src/view/ng_module.js +4 -1
- package/esm5/src/view/provider.js +12 -12
- package/esm5/src/view/pure_expression.js +1 -1
- package/esm5/src/view/query.js +6 -6
- package/esm5/src/view/refs.js +8 -14
- package/esm5/src/view/services.js +16 -20
- package/esm5/src/view/text.js +1 -1
- package/esm5/src/view/types.js +19 -41
- package/esm5/src/view/util.js +5 -5
- package/esm5/src/view/view.js +4 -6
- package/esm5/src/view/view_attach.js +5 -5
- package/esm5/src/zone/ng_zone.js +22 -257
- package/esm5/src/zone.js +2 -1
- package/esm5/testing/index.js +5 -1
- package/esm5/testing/public_api.js +6 -1
- package/esm5/testing/src/async.js +1 -1
- package/esm5/testing/src/async_fallback.js +1 -1
- package/esm5/testing/src/async_test_completer.js +2 -8
- package/esm5/testing/src/before_each.js +6 -1
- package/esm5/testing/src/component_fixture.js +9 -75
- package/esm5/testing/src/fake_async.js +12 -3
- package/esm5/testing/src/fake_async_fallback.js +5 -3
- package/esm5/testing/src/lang_utils.js +1 -1
- package/esm5/testing/src/logger.js +1 -1
- package/esm5/testing/src/metadata_override.js +1 -1
- package/esm5/testing/src/ng_zone_mock.js +1 -1
- package/esm5/testing/src/private_export_testing.js +1 -1
- package/esm5/testing/src/render3.js +1 -5
- package/esm5/testing/src/test_bed.js +20 -172
- package/esm5/testing/src/test_compiler.js +5 -43
- package/esm5/testing/src/testing.js +6 -1
- package/esm5/testing/src/testing_internal.js +3 -9
- package/fesm2015/core.js +248 -177
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/testing.js +9 -13
- package/fesm2015/testing.js.map +1 -1
- package/fesm5/core.js +591 -2007
- package/fesm5/core.js.map +1 -1
- package/fesm5/testing.js +61 -237
- package/fesm5/testing.js.map +1 -1
- package/package.json +1 -1
- package/src/application_ref.d.ts +7 -8
- package/src/change_detection/change_detector_ref.d.ts +6 -4
- package/src/change_detection/differs/iterable_differs.d.ts +3 -2
- package/src/change_detection/differs/keyvalue_differs.d.ts +3 -2
- package/src/change_detection/pipe_transform.d.ts +2 -5
- package/src/di/forward_ref.d.ts +7 -5
- package/src/di/injectable.d.ts +4 -14
- package/src/di/injection_token.d.ts +5 -7
- package/src/di/injector.d.ts +7 -10
- package/src/di/metadata.d.ts +13 -86
- package/src/di/provider.d.ts +55 -150
- package/src/di/reflective_errors.d.ts +13 -6
- package/src/di/reflective_injector.d.ts +21 -23
- package/src/di/reflective_provider.d.ts +7 -8
- package/src/error_handler.d.ts +1 -4
- package/src/event_emitter.d.ts +3 -0
- package/src/i18n/tokens.d.ts +8 -4
- package/src/linker/query_list.d.ts +2 -2
- package/src/linker/view_ref.d.ts +9 -6
- package/src/metadata/di.d.ts +41 -59
- package/src/metadata/directives.d.ts +410 -460
- package/src/metadata/lifecycle_hooks.d.ts +8 -8
- package/src/metadata/ng_module.d.ts +49 -38
- package/src/render3/view_ref.d.ts +6 -2
- package/src/zone/ng_zone.d.ts +1 -0
- package/testing/src/fake_async.d.ts +4 -2
- package/testing/src/fake_async_fallback.d.ts +4 -2
- package/testing/src/metadata_override.d.ts +3 -3
- package/testing.d.ts +0 -5
- package/testing.metadata.json +1 -1
package/bundles/core.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v6.0.
|
|
2
|
+
* @license Angular v6.0.7
|
|
3
3
|
* (c) 2010-2018 Google, Inc. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -179,16 +179,14 @@ function defineInjector(options) {
|
|
|
179
179
|
* overrides the above behavior and marks the token as belonging to a particular `@NgModule`. As
|
|
180
180
|
* mentioned above, `'root'` is the default value for `providedIn`.
|
|
181
181
|
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
* #### Tree-shakeable InjectionToken
|
|
185
|
-
*
|
|
186
|
-
* {@example core/di/ts/injector_spec.ts region='ShakeableInjectionToken'}
|
|
187
|
-
*
|
|
188
|
-
* #### Plain InjectionToken
|
|
182
|
+
* @usageNotes
|
|
183
|
+
* ### Basic Example
|
|
189
184
|
*
|
|
190
185
|
* {@example core/di/ts/injector_spec.ts region='InjectionToken'}
|
|
191
186
|
*
|
|
187
|
+
* ### Tree-shakeable Example
|
|
188
|
+
*
|
|
189
|
+
* {@example core/di/ts/injector_spec.ts region='ShakeableInjectionToken'}
|
|
192
190
|
*
|
|
193
191
|
*/
|
|
194
192
|
var InjectionToken = /** @class */ (function () {
|
|
@@ -353,6 +351,7 @@ function makePropDecorator(name, props, parentClass) {
|
|
|
353
351
|
* All components that are referenced in the `useValue` value (either directly
|
|
354
352
|
* or in a nested array or map) will be added to the `entryComponents` property.
|
|
355
353
|
*
|
|
354
|
+
* @usageNotes
|
|
356
355
|
* ### Example
|
|
357
356
|
* The following example shows how the router can populate the `entryComponents`
|
|
358
357
|
* field of an NgModule based on the router configuration which refers
|
|
@@ -385,17 +384,16 @@ var ANALYZE_FOR_ENTRY_COMPONENTS = new InjectionToken('AnalyzeForEntryComponents
|
|
|
385
384
|
/**
|
|
386
385
|
* Attribute decorator and metadata.
|
|
387
386
|
*
|
|
388
|
-
*
|
|
389
387
|
* @Annotation
|
|
390
388
|
*/
|
|
391
389
|
var Attribute = makeParamDecorator('Attribute', function (attributeName) { return ({ attributeName: attributeName }); });
|
|
392
390
|
/**
|
|
393
391
|
* Base class for query metadata.
|
|
394
392
|
*
|
|
395
|
-
*
|
|
396
|
-
*
|
|
397
|
-
*
|
|
398
|
-
*
|
|
393
|
+
* @see `ContentChildren`.
|
|
394
|
+
* @see `ContentChild`.
|
|
395
|
+
* @see `ViewChildren`.
|
|
396
|
+
* @see `ViewChild`.
|
|
399
397
|
*/
|
|
400
398
|
var Query = /** @class */ (function () {
|
|
401
399
|
function Query() {
|
|
@@ -425,7 +423,6 @@ var ContentChild = makePropDecorator('ContentChild', function (selector, data) {
|
|
|
425
423
|
/**
|
|
426
424
|
* ViewChildren decorator and metadata.
|
|
427
425
|
*
|
|
428
|
-
*
|
|
429
426
|
* @Annotation
|
|
430
427
|
*/
|
|
431
428
|
var ViewChildren = makePropDecorator('ViewChildren', function (selector, data) {
|
|
@@ -435,7 +432,6 @@ var ViewChildren = makePropDecorator('ViewChildren', function (selector, data) {
|
|
|
435
432
|
/**
|
|
436
433
|
* ViewChild decorator and metadata.
|
|
437
434
|
*
|
|
438
|
-
*
|
|
439
435
|
* @Annotation
|
|
440
436
|
*/
|
|
441
437
|
var ViewChild = makePropDecorator('ViewChild', function (selector, data) {
|
|
@@ -449,29 +445,12 @@ var ViewChild = makePropDecorator('ViewChild', function (selector, data) {
|
|
|
449
445
|
* Use of this source code is governed by an MIT-style license that can be
|
|
450
446
|
* found in the LICENSE file at https://angular.io/license
|
|
451
447
|
*/
|
|
452
|
-
/**
|
|
453
|
-
* @license
|
|
454
|
-
* Copyright Google Inc. All Rights Reserved.
|
|
455
|
-
*
|
|
456
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
457
|
-
* found in the LICENSE file at https://angular.io/license
|
|
458
|
-
*/
|
|
459
|
-
/**
|
|
460
|
-
* Describes within the change detector which strategy will be used the next time change
|
|
461
|
-
* detection is triggered.
|
|
462
|
-
*
|
|
463
|
-
*/
|
|
464
448
|
/**
|
|
465
449
|
* Describes within the change detector which strategy will be used the next time change
|
|
466
450
|
* detection is triggered.
|
|
467
451
|
*
|
|
468
452
|
*/
|
|
469
453
|
|
|
470
|
-
/**
|
|
471
|
-
* Describes within the change detector which strategy will be used the next time change
|
|
472
|
-
* detection is triggered.
|
|
473
|
-
*
|
|
474
|
-
*/
|
|
475
454
|
(function (ChangeDetectionStrategy) {
|
|
476
455
|
/**
|
|
477
456
|
* `OnPush` means that the change detector's mode will be initially set to `CheckOnce`.
|
|
@@ -485,13 +464,7 @@ var ViewChild = makePropDecorator('ViewChild', function (selector, data) {
|
|
|
485
464
|
/**
|
|
486
465
|
* Describes the status of the detector.
|
|
487
466
|
*/
|
|
488
|
-
/**
|
|
489
|
-
* Describes the status of the detector.
|
|
490
|
-
*/
|
|
491
467
|
|
|
492
|
-
/**
|
|
493
|
-
* Describes the status of the detector.
|
|
494
|
-
*/
|
|
495
468
|
(function (ChangeDetectorStatus) {
|
|
496
469
|
/**
|
|
497
470
|
* `CheckOnce` means that after calling detectChanges the mode of the change detector
|
|
@@ -537,10 +510,7 @@ function isDefaultChangeDetectionStrategy(changeDetectionStrategy) {
|
|
|
537
510
|
* found in the LICENSE file at https://angular.io/license
|
|
538
511
|
*/
|
|
539
512
|
/**
|
|
540
|
-
*
|
|
541
|
-
*
|
|
542
|
-
*
|
|
543
|
-
* @Annotation
|
|
513
|
+
* Type of the Component metadata.
|
|
544
514
|
*/
|
|
545
515
|
var Directive = makeDecorator('Directive', function (dir) {
|
|
546
516
|
if (dir === void 0) { dir = {}; }
|
|
@@ -549,6 +519,88 @@ var Directive = makeDecorator('Directive', function (dir) {
|
|
|
549
519
|
/**
|
|
550
520
|
* Component decorator and metadata.
|
|
551
521
|
*
|
|
522
|
+
* @usageNotes
|
|
523
|
+
*
|
|
524
|
+
* ### Using animations
|
|
525
|
+
*
|
|
526
|
+
* The following snippet shows an animation trigger in a component's
|
|
527
|
+
* metadata. The trigger is attached to an element in the component's
|
|
528
|
+
* template, using "@_trigger_name_", and a state expression that is evaluated
|
|
529
|
+
* at run time to determine whether the animation should start.
|
|
530
|
+
*
|
|
531
|
+
* ```typescript
|
|
532
|
+
* @Component({
|
|
533
|
+
* selector: 'animation-cmp',
|
|
534
|
+
* templateUrl: 'animation-cmp.html',
|
|
535
|
+
* animations: [
|
|
536
|
+
* trigger('myTriggerName', [
|
|
537
|
+
* state('on', style({ opacity: 1 }),
|
|
538
|
+
* state('off', style({ opacity: 0 }),
|
|
539
|
+
* transition('on => off', [
|
|
540
|
+
* animate("1s")
|
|
541
|
+
* ])
|
|
542
|
+
* ])
|
|
543
|
+
* ]
|
|
544
|
+
* })
|
|
545
|
+
* ```
|
|
546
|
+
*
|
|
547
|
+
* ```html
|
|
548
|
+
* <!-- animation-cmp.html -->
|
|
549
|
+
* <div @myTriggerName="expression">...</div>
|
|
550
|
+
* ```
|
|
551
|
+
*
|
|
552
|
+
* ### Preserving whitespace
|
|
553
|
+
*
|
|
554
|
+
* Removing whitespace can greatly reduce AOT-generated code size, and speed up view creation.
|
|
555
|
+
* As of Angular 6, default for `preserveWhitespaces` is false (whitespace is removed).
|
|
556
|
+
* To change the default setting for all components in your application, set
|
|
557
|
+
* the `preserveWhitespaces` option of the AOT compiler.
|
|
558
|
+
*
|
|
559
|
+
* Current implementation removes whitespace characters as follows:
|
|
560
|
+
* - Trims all whitespaces at the beginning and the end of a template.
|
|
561
|
+
* - Removes whitespace-only text nodes. For example,
|
|
562
|
+
* `<button>Action 1</button> <button>Action 2</button>` becomes
|
|
563
|
+
* `<button>Action 1</button><button>Action 2</button>`.
|
|
564
|
+
* - Replaces a series of whitespace characters in text nodes with a single space.
|
|
565
|
+
* For example, `<span>\n some text\n</span>` becomes `<span> some text </span>`.
|
|
566
|
+
* - Does NOT alter text nodes inside HTML tags such as `<pre>` or `<textarea>`,
|
|
567
|
+
* where whitespace characters are significant.
|
|
568
|
+
*
|
|
569
|
+
* Note that these transformations can influence DOM nodes layout, although impact
|
|
570
|
+
* should be minimal.
|
|
571
|
+
*
|
|
572
|
+
* You can override the default behavior to preserve whitespace characters
|
|
573
|
+
* in certain fragments of a template. For example, you can exclude an entire
|
|
574
|
+
* DOM sub-tree by using the `ngPreserveWhitespaces` attribute:
|
|
575
|
+
*
|
|
576
|
+
* ```html
|
|
577
|
+
* <div ngPreserveWhitespaces>
|
|
578
|
+
* whitespaces are preserved here
|
|
579
|
+
* <span> and here </span>
|
|
580
|
+
* </div>
|
|
581
|
+
* ```
|
|
582
|
+
*
|
|
583
|
+
* You can force a single space to be preserved in a text node by using `&ngsp;`,
|
|
584
|
+
* which is replaced with a space character by Angular's template
|
|
585
|
+
* compiler:
|
|
586
|
+
*
|
|
587
|
+
* ```html
|
|
588
|
+
* <a>Spaces</a>&ngsp;<a>between</a>&ngsp;<a>links.</a>
|
|
589
|
+
* <!-->compiled to be equivalent to:</>
|
|
590
|
+
* <a>Spaces</a> <a>between</a> <a>links.</a>
|
|
591
|
+
* ```
|
|
592
|
+
*
|
|
593
|
+
* Note that sequences of `&ngsp;` are still collapsed to just one space character when
|
|
594
|
+
* the `preserveWhitespaces` option is set to `false`.
|
|
595
|
+
*
|
|
596
|
+
* ```html
|
|
597
|
+
* <a>before</a>&ngsp;&ngsp;&ngsp;<a>after</a>
|
|
598
|
+
* <!-->compiled to be equivalent to:</>
|
|
599
|
+
* <a>Spaces</a> <a>between</a> <a>links.</a>
|
|
600
|
+
* ```
|
|
601
|
+
*
|
|
602
|
+
* To preserve sequences of whitespace characters, use the
|
|
603
|
+
* `ngPreserveWhitespaces` attribute.
|
|
552
604
|
*
|
|
553
605
|
* @Annotation
|
|
554
606
|
*/
|
|
@@ -557,42 +609,54 @@ var Component = makeDecorator('Component', function (c) {
|
|
|
557
609
|
return (__assign({ changeDetection: exports.ChangeDetectionStrategy.Default }, c));
|
|
558
610
|
}, Directive);
|
|
559
611
|
/**
|
|
560
|
-
* Pipe decorator and metadata.
|
|
561
|
-
*
|
|
562
|
-
* Use the `@Pipe` annotation to declare that a given class is a pipe. A pipe
|
|
563
|
-
* class must also implement {@link PipeTransform} interface.
|
|
564
|
-
*
|
|
565
|
-
* To use the pipe include a reference to the pipe class in
|
|
566
|
-
* {@link NgModule#declarations}.
|
|
567
612
|
*
|
|
568
613
|
*
|
|
569
614
|
* @Annotation
|
|
570
615
|
*/
|
|
571
616
|
var Pipe = makeDecorator('Pipe', function (p) { return (__assign({ pure: true }, p)); });
|
|
572
617
|
/**
|
|
573
|
-
* Input decorator and metadata.
|
|
574
|
-
*
|
|
575
618
|
*
|
|
576
619
|
* @Annotation
|
|
577
620
|
*/
|
|
578
621
|
var Input = makePropDecorator('Input', function (bindingPropertyName) { return ({ bindingPropertyName: bindingPropertyName }); });
|
|
579
622
|
/**
|
|
580
|
-
* Output decorator and metadata.
|
|
581
|
-
*
|
|
582
623
|
*
|
|
583
624
|
* @Annotation
|
|
584
625
|
*/
|
|
585
626
|
var Output = makePropDecorator('Output', function (bindingPropertyName) { return ({ bindingPropertyName: bindingPropertyName }); });
|
|
586
627
|
/**
|
|
587
|
-
* HostBinding decorator and metadata.
|
|
588
|
-
*
|
|
589
628
|
*
|
|
590
629
|
* @Annotation
|
|
591
630
|
*/
|
|
592
631
|
var HostBinding = makePropDecorator('HostBinding', function (hostPropertyName) { return ({ hostPropertyName: hostPropertyName }); });
|
|
593
632
|
/**
|
|
594
|
-
*
|
|
633
|
+
* Binds a CSS event to a host listener and supplies configuration metadata.
|
|
634
|
+
* Angular invokes the supplied handler method when the host element emits the specified event,
|
|
635
|
+
* and updates the bound element with the result.
|
|
636
|
+
* If the handler method returns false, applies `preventDefault` on the bound element.
|
|
595
637
|
*
|
|
638
|
+
* @usageNotes
|
|
639
|
+
*
|
|
640
|
+
* The following example declares a directive
|
|
641
|
+
* that attaches a click listener to a button and counts clicks.
|
|
642
|
+
*
|
|
643
|
+
* ```
|
|
644
|
+
* @Directive({selector: 'button[counting]'})
|
|
645
|
+
* class CountClicks {
|
|
646
|
+
* numberOfClicks = 0;
|
|
647
|
+
*
|
|
648
|
+
* @HostListener('click', ['$event.target'])
|
|
649
|
+
* onClick(btn) {
|
|
650
|
+
* console.log('button', btn, 'number of clicks:', this.numberOfClicks++);
|
|
651
|
+
* }
|
|
652
|
+
* }
|
|
653
|
+
*
|
|
654
|
+
* @Component({
|
|
655
|
+
* selector: 'app',
|
|
656
|
+
* template: '<button counting>Increment</button>',
|
|
657
|
+
* })
|
|
658
|
+
* class App {}
|
|
659
|
+
* ```
|
|
596
660
|
*
|
|
597
661
|
* @Annotation
|
|
598
662
|
*/
|
|
@@ -717,9 +781,7 @@ var ReflectionCapabilities = /** @class */ (function () {
|
|
|
717
781
|
return new (t.bind.apply(t, __spread([void 0], args)))();
|
|
718
782
|
}; };
|
|
719
783
|
/** @internal */
|
|
720
|
-
|
|
721
|
-
ReflectionCapabilities.prototype._zipTypesAndAnnotations = /** @internal */
|
|
722
|
-
function (paramTypes, paramAnnotations) {
|
|
784
|
+
ReflectionCapabilities.prototype._zipTypesAndAnnotations = function (paramTypes, paramAnnotations) {
|
|
723
785
|
var result;
|
|
724
786
|
if (typeof paramTypes === 'undefined') {
|
|
725
787
|
result = new Array(paramAnnotations.length);
|
|
@@ -893,10 +955,7 @@ var ReflectionCapabilities = /** @class */ (function () {
|
|
|
893
955
|
return new Function('o', 'args', functionBody);
|
|
894
956
|
};
|
|
895
957
|
// There is not a concept of import uri in Js, but this is useful in developing Dart applications.
|
|
896
|
-
|
|
897
|
-
ReflectionCapabilities.prototype.importUri =
|
|
898
|
-
// There is not a concept of import uri in Js, but this is useful in developing Dart applications.
|
|
899
|
-
function (type) {
|
|
958
|
+
ReflectionCapabilities.prototype.importUri = function (type) {
|
|
900
959
|
// StaticSymbol
|
|
901
960
|
if (typeof type === 'object' && type['filePath']) {
|
|
902
961
|
return type['filePath'];
|
|
@@ -957,10 +1016,10 @@ function getClosureSafeProperty(objWithPropertyToExtract, target) {
|
|
|
957
1016
|
* Allows to refer to references which are not yet defined.
|
|
958
1017
|
*
|
|
959
1018
|
* For instance, `forwardRef` is used when the `token` which we need to refer to for the purposes of
|
|
960
|
-
* DI is declared,
|
|
961
|
-
*
|
|
962
|
-
* yet defined.
|
|
1019
|
+
* DI is declared, but not yet defined. It is also used when the `token` which we use when creating
|
|
1020
|
+
* a query is not yet defined.
|
|
963
1021
|
*
|
|
1022
|
+
* @usageNotes
|
|
964
1023
|
* ### Example
|
|
965
1024
|
* {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref'}
|
|
966
1025
|
* @experimental
|
|
@@ -975,11 +1034,12 @@ function forwardRef(forwardRefFn) {
|
|
|
975
1034
|
*
|
|
976
1035
|
* Acts as the identity function when given a non-forward-ref value.
|
|
977
1036
|
*
|
|
978
|
-
*
|
|
1037
|
+
* @usageNotes
|
|
1038
|
+
* ### Example
|
|
979
1039
|
*
|
|
980
1040
|
* {@example core/di/ts/forward_ref/forward_ref_spec.ts region='resolve_forward_ref'}
|
|
981
1041
|
*
|
|
982
|
-
*
|
|
1042
|
+
* @see `forwardRef`
|
|
983
1043
|
* @experimental
|
|
984
1044
|
*/
|
|
985
1045
|
function resolveForwardRef(type) {
|
|
@@ -1002,35 +1062,30 @@ function resolveForwardRef(type) {
|
|
|
1002
1062
|
/**
|
|
1003
1063
|
* Inject decorator and metadata.
|
|
1004
1064
|
*
|
|
1005
|
-
*
|
|
1006
1065
|
* @Annotation
|
|
1007
1066
|
*/
|
|
1008
1067
|
var Inject = makeParamDecorator('Inject', function (token) { return ({ token: token }); });
|
|
1009
1068
|
/**
|
|
1010
1069
|
* Optional decorator and metadata.
|
|
1011
1070
|
*
|
|
1012
|
-
*
|
|
1013
1071
|
* @Annotation
|
|
1014
1072
|
*/
|
|
1015
1073
|
var Optional = makeParamDecorator('Optional');
|
|
1016
1074
|
/**
|
|
1017
1075
|
* Self decorator and metadata.
|
|
1018
1076
|
*
|
|
1019
|
-
*
|
|
1020
1077
|
* @Annotation
|
|
1021
1078
|
*/
|
|
1022
1079
|
var Self = makeParamDecorator('Self');
|
|
1023
1080
|
/**
|
|
1024
1081
|
* SkipSelf decorator and metadata.
|
|
1025
1082
|
*
|
|
1026
|
-
*
|
|
1027
1083
|
* @Annotation
|
|
1028
1084
|
*/
|
|
1029
1085
|
var SkipSelf = makeParamDecorator('SkipSelf');
|
|
1030
1086
|
/**
|
|
1031
1087
|
* Host decorator and metadata.
|
|
1032
1088
|
*
|
|
1033
|
-
*
|
|
1034
1089
|
* @Annotation
|
|
1035
1090
|
*/
|
|
1036
1091
|
var Host = makeParamDecorator('Host');
|
|
@@ -1067,23 +1122,17 @@ var NullInjector = /** @class */ (function () {
|
|
|
1067
1122
|
return NullInjector;
|
|
1068
1123
|
}());
|
|
1069
1124
|
/**
|
|
1070
|
-
* @usageNotes
|
|
1071
|
-
* ```
|
|
1072
|
-
* const injector: Injector = ...;
|
|
1073
|
-
* injector.get(...);
|
|
1074
|
-
* ```
|
|
1075
|
-
*
|
|
1076
|
-
* @description
|
|
1077
|
-
*
|
|
1078
1125
|
* Concrete injectors implement this interface.
|
|
1079
1126
|
*
|
|
1080
|
-
* For more details, see the
|
|
1127
|
+
* For more details, see the ["Dependency Injection Guide"](guide/dependency-injection).
|
|
1081
1128
|
*
|
|
1129
|
+
* @usageNotes
|
|
1082
1130
|
* ### Example
|
|
1083
1131
|
*
|
|
1084
1132
|
* {@example core/di/ts/injector_spec.ts region='Injector'}
|
|
1085
1133
|
*
|
|
1086
1134
|
* `Injector` returns itself when given `Injector` as a token:
|
|
1135
|
+
*
|
|
1087
1136
|
* {@example core/di/ts/injector_spec.ts region='injectInjector'}
|
|
1088
1137
|
*
|
|
1089
1138
|
*
|
|
@@ -1094,25 +1143,12 @@ var Injector = /** @class */ (function () {
|
|
|
1094
1143
|
/**
|
|
1095
1144
|
* Create a new Injector which is configure using `StaticProvider`s.
|
|
1096
1145
|
*
|
|
1146
|
+
* @usageNotes
|
|
1097
1147
|
* ### Example
|
|
1098
1148
|
*
|
|
1099
1149
|
* {@example core/di/ts/provider_spec.ts region='ConstructorProvider'}
|
|
1100
1150
|
*/
|
|
1101
|
-
|
|
1102
|
-
* Create a new Injector which is configure using `StaticProvider`s.
|
|
1103
|
-
*
|
|
1104
|
-
* ### Example
|
|
1105
|
-
*
|
|
1106
|
-
* {@example core/di/ts/provider_spec.ts region='ConstructorProvider'}
|
|
1107
|
-
*/
|
|
1108
|
-
Injector.create = /**
|
|
1109
|
-
* Create a new Injector which is configure using `StaticProvider`s.
|
|
1110
|
-
*
|
|
1111
|
-
* ### Example
|
|
1112
|
-
*
|
|
1113
|
-
* {@example core/di/ts/provider_spec.ts region='ConstructorProvider'}
|
|
1114
|
-
*/
|
|
1115
|
-
function (options, parent) {
|
|
1151
|
+
Injector.create = function (options, parent) {
|
|
1116
1152
|
if (Array.isArray(options)) {
|
|
1117
1153
|
return new StaticInjector(options, parent);
|
|
1118
1154
|
}
|
|
@@ -1303,7 +1339,12 @@ function resolveToken(token, record, records, parent, notFoundValue, flags) {
|
|
|
1303
1339
|
var childRecord = options & 2 /* CheckSelf */ ? records.get(depRecord.token) : undefined;
|
|
1304
1340
|
deps.push(tryResolveToken(
|
|
1305
1341
|
// Current Token to resolve
|
|
1306
|
-
depRecord.token,
|
|
1342
|
+
depRecord.token,
|
|
1343
|
+
// A record which describes how to resolve the token.
|
|
1344
|
+
// If undefined, this means we don't have such a record
|
|
1345
|
+
childRecord,
|
|
1346
|
+
// Other records we know about.
|
|
1347
|
+
records,
|
|
1307
1348
|
// If we don't know how to resolve dependency and we should not check parent for it,
|
|
1308
1349
|
// than pass in Null injector.
|
|
1309
1350
|
!childRecord && !(options & 4 /* CheckParent */) ? NULL_INJECTOR : parent, options & 1 /* Optional */ ? null : Injector.THROW_IF_NOT_FOUND, 0 /* Default */));
|
|
@@ -1446,7 +1487,7 @@ function injectArgs(types) {
|
|
|
1446
1487
|
type = meta;
|
|
1447
1488
|
}
|
|
1448
1489
|
}
|
|
1449
|
-
args.push(inject(
|
|
1490
|
+
args.push(inject(type, flags));
|
|
1450
1491
|
}
|
|
1451
1492
|
else {
|
|
1452
1493
|
args.push(inject(arg));
|
|
@@ -1503,13 +1544,12 @@ function convertInjectableProviderToFactory(type, provider) {
|
|
|
1503
1544
|
var reflectionCapabilities = new ReflectionCapabilities();
|
|
1504
1545
|
deps_3 = reflectionCapabilities.parameters(type);
|
|
1505
1546
|
}
|
|
1506
|
-
return function () { return new (type.bind.apply(type, __spread([void 0], injectArgs(
|
|
1547
|
+
return function () { return new (type.bind.apply(type, __spread([void 0], injectArgs(deps_3))))(); };
|
|
1507
1548
|
}
|
|
1508
1549
|
}
|
|
1509
1550
|
/**
|
|
1510
1551
|
* Injectable decorator and metadata.
|
|
1511
1552
|
*
|
|
1512
|
-
*
|
|
1513
1553
|
* @Annotation
|
|
1514
1554
|
*/
|
|
1515
1555
|
var Injectable = makeDecorator('Injectable', undefined, undefined, undefined, function (injectableType, options) {
|
|
@@ -1530,10 +1570,10 @@ var Injectable = makeDecorator('Injectable', undefined, undefined, undefined, fu
|
|
|
1530
1570
|
* found in the LICENSE file at https://angular.io/license
|
|
1531
1571
|
*/
|
|
1532
1572
|
/**
|
|
1533
|
-
* Defines a schema that
|
|
1534
|
-
* -
|
|
1535
|
-
* -
|
|
1536
|
-
* elements.
|
|
1573
|
+
* Defines a schema that allows an NgModule to contain the following:
|
|
1574
|
+
* - Non-Angular elements named with dash case (`-`).
|
|
1575
|
+
* - Element properties named with dash case (`-`).
|
|
1576
|
+
* Dash case is the naming convention for custom elements.
|
|
1537
1577
|
*
|
|
1538
1578
|
*
|
|
1539
1579
|
*/
|
|
@@ -1541,7 +1581,7 @@ var CUSTOM_ELEMENTS_SCHEMA = {
|
|
|
1541
1581
|
name: 'custom-elements'
|
|
1542
1582
|
};
|
|
1543
1583
|
/**
|
|
1544
|
-
* Defines a schema that
|
|
1584
|
+
* Defines a schema that allows any property on any element.
|
|
1545
1585
|
*
|
|
1546
1586
|
* @experimental
|
|
1547
1587
|
*/
|
|
@@ -1549,12 +1589,17 @@ var NO_ERRORS_SCHEMA = {
|
|
|
1549
1589
|
name: 'no-errors-schema'
|
|
1550
1590
|
};
|
|
1551
1591
|
/**
|
|
1552
|
-
* NgModule
|
|
1553
|
-
*
|
|
1592
|
+
* Decorator that marks the following class as an NgModule, and supplies
|
|
1593
|
+
* configuration metadata for it.
|
|
1554
1594
|
*
|
|
1555
1595
|
* @Annotation
|
|
1556
1596
|
*/
|
|
1557
|
-
var NgModule = makeDecorator('NgModule', function (ngModule) { return ngModule; }, undefined, undefined,
|
|
1597
|
+
var NgModule = makeDecorator('NgModule', function (ngModule) { return ngModule; }, undefined, undefined,
|
|
1598
|
+
/**
|
|
1599
|
+
* Decorator that marks the following class as an NgModule, and supplies
|
|
1600
|
+
* configuration metadata for it.
|
|
1601
|
+
*/
|
|
1602
|
+
function (moduleType, metadata) {
|
|
1558
1603
|
var imports = (metadata && metadata.imports) || [];
|
|
1559
1604
|
if (metadata && metadata.exports) {
|
|
1560
1605
|
imports = __spread(imports, [metadata.exports]);
|
|
@@ -1566,13 +1611,6 @@ var NgModule = makeDecorator('NgModule', function (ngModule) { return ngModule;
|
|
|
1566
1611
|
});
|
|
1567
1612
|
});
|
|
1568
1613
|
|
|
1569
|
-
/**
|
|
1570
|
-
* @license
|
|
1571
|
-
* Copyright Google Inc. All Rights Reserved.
|
|
1572
|
-
*
|
|
1573
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
1574
|
-
* found in the LICENSE file at https://angular.io/license
|
|
1575
|
-
*/
|
|
1576
1614
|
/**
|
|
1577
1615
|
* @license
|
|
1578
1616
|
* Copyright Google Inc. All Rights Reserved.
|
|
@@ -1586,19 +1624,7 @@ var NgModule = makeDecorator('NgModule', function (ngModule) { return ngModule;
|
|
|
1586
1624
|
* See {@link Component#encapsulation encapsulation}.
|
|
1587
1625
|
*
|
|
1588
1626
|
*/
|
|
1589
|
-
/**
|
|
1590
|
-
* Defines template and style encapsulation options available for Component's {@link Component}.
|
|
1591
|
-
*
|
|
1592
|
-
* See {@link Component#encapsulation encapsulation}.
|
|
1593
|
-
*
|
|
1594
|
-
*/
|
|
1595
1627
|
|
|
1596
|
-
/**
|
|
1597
|
-
* Defines template and style encapsulation options available for Component's {@link Component}.
|
|
1598
|
-
*
|
|
1599
|
-
* See {@link Component#encapsulation encapsulation}.
|
|
1600
|
-
*
|
|
1601
|
-
*/
|
|
1602
1628
|
(function (ViewEncapsulation) {
|
|
1603
1629
|
/**
|
|
1604
1630
|
* Emulate `Native` scoping of styles by adding an attribute containing surrogate id to the Host
|
|
@@ -1651,7 +1677,7 @@ var Version = /** @class */ (function () {
|
|
|
1651
1677
|
}
|
|
1652
1678
|
return Version;
|
|
1653
1679
|
}());
|
|
1654
|
-
var VERSION = new Version('6.0.
|
|
1680
|
+
var VERSION = new Version('6.0.7');
|
|
1655
1681
|
|
|
1656
1682
|
/**
|
|
1657
1683
|
* @license
|
|
@@ -1690,14 +1716,13 @@ function defaultErrorLogger(console) {
|
|
|
1690
1716
|
* found in the LICENSE file at https://angular.io/license
|
|
1691
1717
|
*/
|
|
1692
1718
|
/**
|
|
1693
|
-
*
|
|
1694
|
-
* @description
|
|
1695
1719
|
* Provides a hook for centralized exception handling.
|
|
1696
1720
|
*
|
|
1697
1721
|
* The default implementation of `ErrorHandler` prints error messages to the `console`. To
|
|
1698
1722
|
* intercept error handling, write a custom exception handler that replaces this default as
|
|
1699
1723
|
* appropriate for your app.
|
|
1700
1724
|
*
|
|
1725
|
+
* @usageNotes
|
|
1701
1726
|
* ### Example
|
|
1702
1727
|
*
|
|
1703
1728
|
* ```
|
|
@@ -1712,14 +1737,12 @@ function defaultErrorLogger(console) {
|
|
|
1712
1737
|
* })
|
|
1713
1738
|
* class MyModule {}
|
|
1714
1739
|
* ```
|
|
1715
|
-
*
|
|
1716
|
-
*
|
|
1717
1740
|
*/
|
|
1718
1741
|
var ErrorHandler = /** @class */ (function () {
|
|
1719
1742
|
function ErrorHandler() {
|
|
1720
1743
|
/**
|
|
1721
|
-
|
|
1722
|
-
|
|
1744
|
+
* @internal
|
|
1745
|
+
*/
|
|
1723
1746
|
this._console = console;
|
|
1724
1747
|
}
|
|
1725
1748
|
ErrorHandler.prototype.handleError = function (error) {
|
|
@@ -1737,9 +1760,7 @@ var ErrorHandler = /** @class */ (function () {
|
|
|
1737
1760
|
}
|
|
1738
1761
|
};
|
|
1739
1762
|
/** @internal */
|
|
1740
|
-
|
|
1741
|
-
ErrorHandler.prototype._findContext = /** @internal */
|
|
1742
|
-
function (error) {
|
|
1763
|
+
ErrorHandler.prototype._findContext = function (error) {
|
|
1743
1764
|
if (error) {
|
|
1744
1765
|
return getDebugContext(error) ? getDebugContext(error) :
|
|
1745
1766
|
this._findContext(getOriginalError(error));
|
|
@@ -1747,9 +1768,7 @@ var ErrorHandler = /** @class */ (function () {
|
|
|
1747
1768
|
return null;
|
|
1748
1769
|
};
|
|
1749
1770
|
/** @internal */
|
|
1750
|
-
|
|
1751
|
-
ErrorHandler.prototype._findOriginalError = /** @internal */
|
|
1752
|
-
function (error) {
|
|
1771
|
+
ErrorHandler.prototype._findOriginalError = function (error) {
|
|
1753
1772
|
var e = getOriginalError(error);
|
|
1754
1773
|
while (e && getOriginalError(e)) {
|
|
1755
1774
|
e = getOriginalError(e);
|
|
@@ -1812,7 +1831,8 @@ function addKey(injector, key) {
|
|
|
1812
1831
|
* Thrown when trying to retrieve a dependency by key from {@link Injector}, but the
|
|
1813
1832
|
* {@link Injector} does not have a {@link Provider} for the given key.
|
|
1814
1833
|
*
|
|
1815
|
-
*
|
|
1834
|
+
* @usageNotes
|
|
1835
|
+
* ### Example
|
|
1816
1836
|
*
|
|
1817
1837
|
* ```typescript
|
|
1818
1838
|
* class A {
|
|
@@ -1831,7 +1851,8 @@ function noProviderError(injector, key) {
|
|
|
1831
1851
|
/**
|
|
1832
1852
|
* Thrown when dependencies form a cycle.
|
|
1833
1853
|
*
|
|
1834
|
-
*
|
|
1854
|
+
* @usageNotes
|
|
1855
|
+
* ### Example
|
|
1835
1856
|
*
|
|
1836
1857
|
* ```typescript
|
|
1837
1858
|
* var injector = Injector.resolveAndCreate([
|
|
@@ -1855,7 +1876,8 @@ function cyclicDependencyError(injector, key) {
|
|
|
1855
1876
|
* The `InstantiationError` class contains the original error plus the dependency graph which caused
|
|
1856
1877
|
* this object to be instantiated.
|
|
1857
1878
|
*
|
|
1858
|
-
*
|
|
1879
|
+
* @usageNotes
|
|
1880
|
+
* ### Example
|
|
1859
1881
|
*
|
|
1860
1882
|
* ```typescript
|
|
1861
1883
|
* class A {
|
|
@@ -1885,7 +1907,8 @@ function instantiationError(injector, originalException, originalStack, key) {
|
|
|
1885
1907
|
* Thrown when an object other then {@link Provider} (or `Type`) is passed to {@link Injector}
|
|
1886
1908
|
* creation.
|
|
1887
1909
|
*
|
|
1888
|
-
*
|
|
1910
|
+
* @usageNotes
|
|
1911
|
+
* ### Example
|
|
1889
1912
|
*
|
|
1890
1913
|
* ```typescript
|
|
1891
1914
|
* expect(() => Injector.resolveAndCreate(["not a type"])).toThrowError();
|
|
@@ -1900,7 +1923,8 @@ function invalidProviderError(provider) {
|
|
|
1900
1923
|
* Lack of annotation information prevents the {@link Injector} from determining which dependencies
|
|
1901
1924
|
* need to be injected into the constructor.
|
|
1902
1925
|
*
|
|
1903
|
-
*
|
|
1926
|
+
* @usageNotes
|
|
1927
|
+
* ### Example
|
|
1904
1928
|
*
|
|
1905
1929
|
* ```typescript
|
|
1906
1930
|
* class A {
|
|
@@ -1942,7 +1966,8 @@ function noAnnotationError(typeOrFunc, params) {
|
|
|
1942
1966
|
/**
|
|
1943
1967
|
* Thrown when getting an object by index.
|
|
1944
1968
|
*
|
|
1945
|
-
*
|
|
1969
|
+
* @usageNotes
|
|
1970
|
+
* ### Example
|
|
1946
1971
|
*
|
|
1947
1972
|
* ```typescript
|
|
1948
1973
|
* class A {}
|
|
@@ -1960,6 +1985,7 @@ function outOfBoundsError(index) {
|
|
|
1960
1985
|
/**
|
|
1961
1986
|
* Thrown when a multi provider and a regular provider are bound to the same token.
|
|
1962
1987
|
*
|
|
1988
|
+
* @usageNotes
|
|
1963
1989
|
* ### Example
|
|
1964
1990
|
*
|
|
1965
1991
|
* ```typescript
|
|
@@ -2011,23 +2037,14 @@ var ReflectiveKey = /** @class */ (function () {
|
|
|
2011
2037
|
/**
|
|
2012
2038
|
* Retrieves a `Key` for a token.
|
|
2013
2039
|
*/
|
|
2014
|
-
|
|
2015
|
-
* Retrieves a `Key` for a token.
|
|
2016
|
-
*/
|
|
2017
|
-
ReflectiveKey.get = /**
|
|
2018
|
-
* Retrieves a `Key` for a token.
|
|
2019
|
-
*/
|
|
2020
|
-
function (token) {
|
|
2040
|
+
ReflectiveKey.get = function (token) {
|
|
2021
2041
|
return _globalKeyRegistry.get(resolveForwardRef(token));
|
|
2022
2042
|
};
|
|
2023
2043
|
Object.defineProperty(ReflectiveKey, "numberOfKeys", {
|
|
2024
2044
|
/**
|
|
2025
2045
|
* @returns the number of keys registered in the system.
|
|
2026
2046
|
*/
|
|
2027
|
-
get:
|
|
2028
|
-
* @returns the number of keys registered in the system.
|
|
2029
|
-
*/
|
|
2030
|
-
function () { return _globalKeyRegistry.numberOfKeys; },
|
|
2047
|
+
get: function () { return _globalKeyRegistry.numberOfKeys; },
|
|
2031
2048
|
enumerable: true,
|
|
2032
2049
|
configurable: true
|
|
2033
2050
|
});
|
|
@@ -2145,17 +2162,18 @@ var ResolvedReflectiveProvider_ = /** @class */ (function () {
|
|
|
2145
2162
|
return ResolvedReflectiveProvider_;
|
|
2146
2163
|
}());
|
|
2147
2164
|
/**
|
|
2148
|
-
* An internal resolved representation of a factory function created by resolving
|
|
2149
|
-
* Provider}.
|
|
2165
|
+
* An internal resolved representation of a factory function created by resolving `Provider`.
|
|
2150
2166
|
* @experimental
|
|
2151
2167
|
*/
|
|
2152
2168
|
var ResolvedReflectiveFactory = /** @class */ (function () {
|
|
2153
|
-
function ResolvedReflectiveFactory(
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2169
|
+
function ResolvedReflectiveFactory(
|
|
2170
|
+
/**
|
|
2171
|
+
* Factory function which can return an instance of an object represented by a key.
|
|
2172
|
+
*/
|
|
2173
|
+
factory,
|
|
2174
|
+
/**
|
|
2175
|
+
* Arguments (dependencies) to the `factory` function.
|
|
2176
|
+
*/
|
|
2159
2177
|
dependencies) {
|
|
2160
2178
|
this.factory = factory;
|
|
2161
2179
|
this.dependencies = dependencies;
|
|
@@ -2188,10 +2206,10 @@ function resolveReflectiveFactory(provider) {
|
|
|
2188
2206
|
return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);
|
|
2189
2207
|
}
|
|
2190
2208
|
/**
|
|
2191
|
-
* Converts the
|
|
2209
|
+
* Converts the `Provider` into `ResolvedProvider`.
|
|
2192
2210
|
*
|
|
2193
|
-
*
|
|
2194
|
-
*
|
|
2211
|
+
* `Injector` internally only uses `ResolvedProvider`, `Provider` contains convenience provider
|
|
2212
|
+
* syntax.
|
|
2195
2213
|
*/
|
|
2196
2214
|
function resolveReflectiveProvider(provider) {
|
|
2197
2215
|
return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);
|
|
@@ -2206,9 +2224,8 @@ function resolveReflectiveProviders(providers) {
|
|
|
2206
2224
|
return Array.from(resolvedProviderMap.values());
|
|
2207
2225
|
}
|
|
2208
2226
|
/**
|
|
2209
|
-
* Merges a list of ResolvedProviders into a list where
|
|
2210
|
-
*
|
|
2211
|
-
* have been merged.
|
|
2227
|
+
* Merges a list of ResolvedProviders into a list where each key is contained exactly once and
|
|
2228
|
+
* multi providers have been merged.
|
|
2212
2229
|
*/
|
|
2213
2230
|
function mergeResolvedReflectiveProviders(providers, normalizedProvidersMap) {
|
|
2214
2231
|
for (var i = 0; i < providers.length; i++) {
|
|
@@ -2336,7 +2353,8 @@ var UNDEFINED = new Object();
|
|
|
2336
2353
|
* In typical use, application code asks for the dependencies in the constructor and they are
|
|
2337
2354
|
* resolved by the `Injector`.
|
|
2338
2355
|
*
|
|
2339
|
-
*
|
|
2356
|
+
* @usageNotes
|
|
2357
|
+
* ### Example
|
|
2340
2358
|
*
|
|
2341
2359
|
* The following example creates an `Injector` configured to create `Engine` and `Car`.
|
|
2342
2360
|
*
|
|
@@ -2368,9 +2386,10 @@ var ReflectiveInjector = /** @class */ (function () {
|
|
|
2368
2386
|
* Turns an array of provider definitions into an array of resolved providers.
|
|
2369
2387
|
*
|
|
2370
2388
|
* A resolution is a process of flattening multiple nested arrays and converting individual
|
|
2371
|
-
* providers into an array of
|
|
2389
|
+
* providers into an array of `ResolvedReflectiveProvider`s.
|
|
2372
2390
|
*
|
|
2373
|
-
*
|
|
2391
|
+
* @usageNotes
|
|
2392
|
+
* ### Example
|
|
2374
2393
|
*
|
|
2375
2394
|
* ```typescript
|
|
2376
2395
|
* @Injectable()
|
|
@@ -2395,84 +2414,18 @@ var ReflectiveInjector = /** @class */ (function () {
|
|
|
2395
2414
|
* });
|
|
2396
2415
|
* ```
|
|
2397
2416
|
*
|
|
2398
|
-
* See {@link ReflectiveInjector#fromResolvedProviders fromResolvedProviders} for more info.
|
|
2399
2417
|
*/
|
|
2400
|
-
|
|
2401
|
-
* Turns an array of provider definitions into an array of resolved providers.
|
|
2402
|
-
*
|
|
2403
|
-
* A resolution is a process of flattening multiple nested arrays and converting individual
|
|
2404
|
-
* providers into an array of {@link ResolvedReflectiveProvider}s.
|
|
2405
|
-
*
|
|
2406
|
-
* ### Example ([live demo](http://plnkr.co/edit/AiXTHi?p=preview))
|
|
2407
|
-
*
|
|
2408
|
-
* ```typescript
|
|
2409
|
-
* @Injectable()
|
|
2410
|
-
* class Engine {
|
|
2411
|
-
* }
|
|
2412
|
-
*
|
|
2413
|
-
* @Injectable()
|
|
2414
|
-
* class Car {
|
|
2415
|
-
* constructor(public engine:Engine) {}
|
|
2416
|
-
* }
|
|
2417
|
-
*
|
|
2418
|
-
* var providers = ReflectiveInjector.resolve([Car, [[Engine]]]);
|
|
2419
|
-
*
|
|
2420
|
-
* expect(providers.length).toEqual(2);
|
|
2421
|
-
*
|
|
2422
|
-
* expect(providers[0] instanceof ResolvedReflectiveProvider).toBe(true);
|
|
2423
|
-
* expect(providers[0].key.displayName).toBe("Car");
|
|
2424
|
-
* expect(providers[0].dependencies.length).toEqual(1);
|
|
2425
|
-
* expect(providers[0].factory).toBeDefined();
|
|
2426
|
-
*
|
|
2427
|
-
* expect(providers[1].key.displayName).toBe("Engine");
|
|
2428
|
-
* });
|
|
2429
|
-
* ```
|
|
2430
|
-
*
|
|
2431
|
-
* See {@link ReflectiveInjector#fromResolvedProviders fromResolvedProviders} for more info.
|
|
2432
|
-
*/
|
|
2433
|
-
ReflectiveInjector.resolve = /**
|
|
2434
|
-
* Turns an array of provider definitions into an array of resolved providers.
|
|
2435
|
-
*
|
|
2436
|
-
* A resolution is a process of flattening multiple nested arrays and converting individual
|
|
2437
|
-
* providers into an array of {@link ResolvedReflectiveProvider}s.
|
|
2438
|
-
*
|
|
2439
|
-
* ### Example ([live demo](http://plnkr.co/edit/AiXTHi?p=preview))
|
|
2440
|
-
*
|
|
2441
|
-
* ```typescript
|
|
2442
|
-
* @Injectable()
|
|
2443
|
-
* class Engine {
|
|
2444
|
-
* }
|
|
2445
|
-
*
|
|
2446
|
-
* @Injectable()
|
|
2447
|
-
* class Car {
|
|
2448
|
-
* constructor(public engine:Engine) {}
|
|
2449
|
-
* }
|
|
2450
|
-
*
|
|
2451
|
-
* var providers = ReflectiveInjector.resolve([Car, [[Engine]]]);
|
|
2452
|
-
*
|
|
2453
|
-
* expect(providers.length).toEqual(2);
|
|
2454
|
-
*
|
|
2455
|
-
* expect(providers[0] instanceof ResolvedReflectiveProvider).toBe(true);
|
|
2456
|
-
* expect(providers[0].key.displayName).toBe("Car");
|
|
2457
|
-
* expect(providers[0].dependencies.length).toEqual(1);
|
|
2458
|
-
* expect(providers[0].factory).toBeDefined();
|
|
2459
|
-
*
|
|
2460
|
-
* expect(providers[1].key.displayName).toBe("Engine");
|
|
2461
|
-
* });
|
|
2462
|
-
* ```
|
|
2463
|
-
*
|
|
2464
|
-
* See {@link ReflectiveInjector#fromResolvedProviders fromResolvedProviders} for more info.
|
|
2465
|
-
*/
|
|
2466
|
-
function (providers) {
|
|
2418
|
+
ReflectiveInjector.resolve = function (providers) {
|
|
2467
2419
|
return resolveReflectiveProviders(providers);
|
|
2468
2420
|
};
|
|
2469
2421
|
/**
|
|
2470
2422
|
* Resolves an array of providers and creates an injector from those providers.
|
|
2471
2423
|
*
|
|
2472
|
-
* The passed-in providers can be an array of `Type`,
|
|
2424
|
+
* The passed-in providers can be an array of `Type`, `Provider`,
|
|
2473
2425
|
* or a recursive array of more providers.
|
|
2474
2426
|
*
|
|
2475
|
-
*
|
|
2427
|
+
* @usageNotes
|
|
2428
|
+
* ### Example
|
|
2476
2429
|
*
|
|
2477
2430
|
* ```typescript
|
|
2478
2431
|
* @Injectable()
|
|
@@ -2487,67 +2440,8 @@ var ReflectiveInjector = /** @class */ (function () {
|
|
|
2487
2440
|
* var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]);
|
|
2488
2441
|
* expect(injector.get(Car) instanceof Car).toBe(true);
|
|
2489
2442
|
* ```
|
|
2490
|
-
*
|
|
2491
|
-
* This function is slower than the corresponding `fromResolvedProviders`
|
|
2492
|
-
* because it needs to resolve the passed-in providers first.
|
|
2493
|
-
* See {@link ReflectiveInjector#resolve resolve} and
|
|
2494
|
-
* {@link ReflectiveInjector#fromResolvedProviders fromResolvedProviders}.
|
|
2495
2443
|
*/
|
|
2496
|
-
|
|
2497
|
-
* Resolves an array of providers and creates an injector from those providers.
|
|
2498
|
-
*
|
|
2499
|
-
* The passed-in providers can be an array of `Type`, {@link Provider},
|
|
2500
|
-
* or a recursive array of more providers.
|
|
2501
|
-
*
|
|
2502
|
-
* ### Example ([live demo](http://plnkr.co/edit/ePOccA?p=preview))
|
|
2503
|
-
*
|
|
2504
|
-
* ```typescript
|
|
2505
|
-
* @Injectable()
|
|
2506
|
-
* class Engine {
|
|
2507
|
-
* }
|
|
2508
|
-
*
|
|
2509
|
-
* @Injectable()
|
|
2510
|
-
* class Car {
|
|
2511
|
-
* constructor(public engine:Engine) {}
|
|
2512
|
-
* }
|
|
2513
|
-
*
|
|
2514
|
-
* var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]);
|
|
2515
|
-
* expect(injector.get(Car) instanceof Car).toBe(true);
|
|
2516
|
-
* ```
|
|
2517
|
-
*
|
|
2518
|
-
* This function is slower than the corresponding `fromResolvedProviders`
|
|
2519
|
-
* because it needs to resolve the passed-in providers first.
|
|
2520
|
-
* See {@link ReflectiveInjector#resolve resolve} and
|
|
2521
|
-
* {@link ReflectiveInjector#fromResolvedProviders fromResolvedProviders}.
|
|
2522
|
-
*/
|
|
2523
|
-
ReflectiveInjector.resolveAndCreate = /**
|
|
2524
|
-
* Resolves an array of providers and creates an injector from those providers.
|
|
2525
|
-
*
|
|
2526
|
-
* The passed-in providers can be an array of `Type`, {@link Provider},
|
|
2527
|
-
* or a recursive array of more providers.
|
|
2528
|
-
*
|
|
2529
|
-
* ### Example ([live demo](http://plnkr.co/edit/ePOccA?p=preview))
|
|
2530
|
-
*
|
|
2531
|
-
* ```typescript
|
|
2532
|
-
* @Injectable()
|
|
2533
|
-
* class Engine {
|
|
2534
|
-
* }
|
|
2535
|
-
*
|
|
2536
|
-
* @Injectable()
|
|
2537
|
-
* class Car {
|
|
2538
|
-
* constructor(public engine:Engine) {}
|
|
2539
|
-
* }
|
|
2540
|
-
*
|
|
2541
|
-
* var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]);
|
|
2542
|
-
* expect(injector.get(Car) instanceof Car).toBe(true);
|
|
2543
|
-
* ```
|
|
2544
|
-
*
|
|
2545
|
-
* This function is slower than the corresponding `fromResolvedProviders`
|
|
2546
|
-
* because it needs to resolve the passed-in providers first.
|
|
2547
|
-
* See {@link ReflectiveInjector#resolve resolve} and
|
|
2548
|
-
* {@link ReflectiveInjector#fromResolvedProviders fromResolvedProviders}.
|
|
2549
|
-
*/
|
|
2550
|
-
function (providers, parent) {
|
|
2444
|
+
ReflectiveInjector.resolveAndCreate = function (providers, parent) {
|
|
2551
2445
|
var ResolvedReflectiveProviders = ReflectiveInjector.resolve(providers);
|
|
2552
2446
|
return ReflectiveInjector.fromResolvedProviders(ResolvedReflectiveProviders, parent);
|
|
2553
2447
|
};
|
|
@@ -2556,7 +2450,8 @@ var ReflectiveInjector = /** @class */ (function () {
|
|
|
2556
2450
|
*
|
|
2557
2451
|
* This API is the recommended way to construct injectors in performance-sensitive parts.
|
|
2558
2452
|
*
|
|
2559
|
-
*
|
|
2453
|
+
* @usageNotes
|
|
2454
|
+
* ### Example
|
|
2560
2455
|
*
|
|
2561
2456
|
* ```typescript
|
|
2562
2457
|
* @Injectable()
|
|
@@ -2574,53 +2469,7 @@ var ReflectiveInjector = /** @class */ (function () {
|
|
|
2574
2469
|
* ```
|
|
2575
2470
|
* @experimental
|
|
2576
2471
|
*/
|
|
2577
|
-
|
|
2578
|
-
* Creates an injector from previously resolved providers.
|
|
2579
|
-
*
|
|
2580
|
-
* This API is the recommended way to construct injectors in performance-sensitive parts.
|
|
2581
|
-
*
|
|
2582
|
-
* ### Example ([live demo](http://plnkr.co/edit/KrSMci?p=preview))
|
|
2583
|
-
*
|
|
2584
|
-
* ```typescript
|
|
2585
|
-
* @Injectable()
|
|
2586
|
-
* class Engine {
|
|
2587
|
-
* }
|
|
2588
|
-
*
|
|
2589
|
-
* @Injectable()
|
|
2590
|
-
* class Car {
|
|
2591
|
-
* constructor(public engine:Engine) {}
|
|
2592
|
-
* }
|
|
2593
|
-
*
|
|
2594
|
-
* var providers = ReflectiveInjector.resolve([Car, Engine]);
|
|
2595
|
-
* var injector = ReflectiveInjector.fromResolvedProviders(providers);
|
|
2596
|
-
* expect(injector.get(Car) instanceof Car).toBe(true);
|
|
2597
|
-
* ```
|
|
2598
|
-
* @experimental
|
|
2599
|
-
*/
|
|
2600
|
-
ReflectiveInjector.fromResolvedProviders = /**
|
|
2601
|
-
* Creates an injector from previously resolved providers.
|
|
2602
|
-
*
|
|
2603
|
-
* This API is the recommended way to construct injectors in performance-sensitive parts.
|
|
2604
|
-
*
|
|
2605
|
-
* ### Example ([live demo](http://plnkr.co/edit/KrSMci?p=preview))
|
|
2606
|
-
*
|
|
2607
|
-
* ```typescript
|
|
2608
|
-
* @Injectable()
|
|
2609
|
-
* class Engine {
|
|
2610
|
-
* }
|
|
2611
|
-
*
|
|
2612
|
-
* @Injectable()
|
|
2613
|
-
* class Car {
|
|
2614
|
-
* constructor(public engine:Engine) {}
|
|
2615
|
-
* }
|
|
2616
|
-
*
|
|
2617
|
-
* var providers = ReflectiveInjector.resolve([Car, Engine]);
|
|
2618
|
-
* var injector = ReflectiveInjector.fromResolvedProviders(providers);
|
|
2619
|
-
* expect(injector.get(Car) instanceof Car).toBe(true);
|
|
2620
|
-
* ```
|
|
2621
|
-
* @experimental
|
|
2622
|
-
*/
|
|
2623
|
-
function (providers, parent) {
|
|
2472
|
+
ReflectiveInjector.fromResolvedProviders = function (providers, parent) {
|
|
2624
2473
|
return new ReflectiveInjector_(providers, parent);
|
|
2625
2474
|
};
|
|
2626
2475
|
return ReflectiveInjector;
|
|
@@ -2668,9 +2517,7 @@ var ReflectiveInjector_ = /** @class */ (function () {
|
|
|
2668
2517
|
return this._providers[index];
|
|
2669
2518
|
};
|
|
2670
2519
|
/** @internal */
|
|
2671
|
-
|
|
2672
|
-
ReflectiveInjector_.prototype._new = /** @internal */
|
|
2673
|
-
function (provider) {
|
|
2520
|
+
ReflectiveInjector_.prototype._new = function (provider) {
|
|
2674
2521
|
if (this._constructionCounter++ > this._getMaxNumberOfObjects()) {
|
|
2675
2522
|
throw cyclicDependencyError(this, provider.key);
|
|
2676
2523
|
}
|
|
@@ -2738,9 +2585,7 @@ var ReflectiveInjector_ = /** @class */ (function () {
|
|
|
2738
2585
|
return UNDEFINED;
|
|
2739
2586
|
};
|
|
2740
2587
|
/** @internal */
|
|
2741
|
-
|
|
2742
|
-
ReflectiveInjector_.prototype._throwOrNull = /** @internal */
|
|
2743
|
-
function (key, notFoundValue) {
|
|
2588
|
+
ReflectiveInjector_.prototype._throwOrNull = function (key, notFoundValue) {
|
|
2744
2589
|
if (notFoundValue !== THROW_IF_NOT_FOUND) {
|
|
2745
2590
|
return notFoundValue;
|
|
2746
2591
|
}
|
|
@@ -2749,16 +2594,12 @@ var ReflectiveInjector_ = /** @class */ (function () {
|
|
|
2749
2594
|
}
|
|
2750
2595
|
};
|
|
2751
2596
|
/** @internal */
|
|
2752
|
-
|
|
2753
|
-
ReflectiveInjector_.prototype._getByKeySelf = /** @internal */
|
|
2754
|
-
function (key, notFoundValue) {
|
|
2597
|
+
ReflectiveInjector_.prototype._getByKeySelf = function (key, notFoundValue) {
|
|
2755
2598
|
var obj = this._getObjByKeyId(key.id);
|
|
2756
2599
|
return (obj !== UNDEFINED) ? obj : this._throwOrNull(key, notFoundValue);
|
|
2757
2600
|
};
|
|
2758
2601
|
/** @internal */
|
|
2759
|
-
|
|
2760
|
-
ReflectiveInjector_.prototype._getByKeyDefault = /** @internal */
|
|
2761
|
-
function (key, notFoundValue, visibility) {
|
|
2602
|
+
ReflectiveInjector_.prototype._getByKeyDefault = function (key, notFoundValue, visibility) {
|
|
2762
2603
|
var inj;
|
|
2763
2604
|
if (visibility instanceof SkipSelf) {
|
|
2764
2605
|
inj = this.parent;
|
|
@@ -2860,20 +2701,20 @@ var R3Injector = /** @class */ (function () {
|
|
|
2860
2701
|
var _this = this;
|
|
2861
2702
|
this.parent = parent;
|
|
2862
2703
|
/**
|
|
2863
|
-
|
|
2864
|
-
|
|
2704
|
+
* Map of tokens to records which contain the instances of those tokens.
|
|
2705
|
+
*/
|
|
2865
2706
|
this.records = new Map();
|
|
2866
2707
|
/**
|
|
2867
|
-
|
|
2868
|
-
|
|
2708
|
+
* The transitive set of `InjectorType`s which define this injector.
|
|
2709
|
+
*/
|
|
2869
2710
|
this.injectorDefTypes = new Set();
|
|
2870
2711
|
/**
|
|
2871
|
-
|
|
2872
|
-
|
|
2712
|
+
* Set of values instantiated by this injector which contain `ngOnDestroy` lifecycle hooks.
|
|
2713
|
+
*/
|
|
2873
2714
|
this.onDestroy = new Set();
|
|
2874
2715
|
/**
|
|
2875
|
-
|
|
2876
|
-
|
|
2716
|
+
* Flag indicating that this injector was previously destroyed.
|
|
2717
|
+
*/
|
|
2877
2718
|
this.destroyed = false;
|
|
2878
2719
|
// Start off by creating Records for every provider declared in every InjectorType
|
|
2879
2720
|
// included transitively in `def`.
|
|
@@ -2892,19 +2733,7 @@ var R3Injector = /** @class */ (function () {
|
|
|
2892
2733
|
* Also calls the `OnDestroy` lifecycle hooks of every instance that was created for which a
|
|
2893
2734
|
* hook was found.
|
|
2894
2735
|
*/
|
|
2895
|
-
|
|
2896
|
-
* Destroy the injector and release references to every instance or provider associated with it.
|
|
2897
|
-
*
|
|
2898
|
-
* Also calls the `OnDestroy` lifecycle hooks of every instance that was created for which a
|
|
2899
|
-
* hook was found.
|
|
2900
|
-
*/
|
|
2901
|
-
R3Injector.prototype.destroy = /**
|
|
2902
|
-
* Destroy the injector and release references to every instance or provider associated with it.
|
|
2903
|
-
*
|
|
2904
|
-
* Also calls the `OnDestroy` lifecycle hooks of every instance that was created for which a
|
|
2905
|
-
* hook was found.
|
|
2906
|
-
*/
|
|
2907
|
-
function () {
|
|
2736
|
+
R3Injector.prototype.destroy = function () {
|
|
2908
2737
|
this.assertNotDestroyed();
|
|
2909
2738
|
// Set destroyed = true first, in case lifecycle hooks re-enter destroy().
|
|
2910
2739
|
this.destroyed = true;
|
|
@@ -2967,15 +2796,7 @@ var R3Injector = /** @class */ (function () {
|
|
|
2967
2796
|
* Add an `InjectorType` or `InjectorDefTypeWithProviders` and all of its transitive providers
|
|
2968
2797
|
* to this injector.
|
|
2969
2798
|
*/
|
|
2970
|
-
|
|
2971
|
-
* Add an `InjectorType` or `InjectorDefTypeWithProviders` and all of its transitive providers
|
|
2972
|
-
* to this injector.
|
|
2973
|
-
*/
|
|
2974
|
-
R3Injector.prototype.processInjectorType = /**
|
|
2975
|
-
* Add an `InjectorType` or `InjectorDefTypeWithProviders` and all of its transitive providers
|
|
2976
|
-
* to this injector.
|
|
2977
|
-
*/
|
|
2978
|
-
function (defOrWrappedDef, parents) {
|
|
2799
|
+
R3Injector.prototype.processInjectorType = function (defOrWrappedDef, parents) {
|
|
2979
2800
|
var _this = this;
|
|
2980
2801
|
defOrWrappedDef = resolveForwardRef(defOrWrappedDef);
|
|
2981
2802
|
// Either the defOrWrappedDef is an InjectorType (with ngInjectorDef) or an
|
|
@@ -3033,13 +2854,7 @@ var R3Injector = /** @class */ (function () {
|
|
|
3033
2854
|
/**
|
|
3034
2855
|
* Process a `SingleProvider` and add it.
|
|
3035
2856
|
*/
|
|
3036
|
-
|
|
3037
|
-
* Process a `SingleProvider` and add it.
|
|
3038
|
-
*/
|
|
3039
|
-
R3Injector.prototype.processProvider = /**
|
|
3040
|
-
* Process a `SingleProvider` and add it.
|
|
3041
|
-
*/
|
|
3042
|
-
function (provider) {
|
|
2857
|
+
R3Injector.prototype.processProvider = function (provider) {
|
|
3043
2858
|
// Determine the token from the provider. Either it's its own token, or has a {provide: ...}
|
|
3044
2859
|
// property.
|
|
3045
2860
|
provider = resolveForwardRef(provider);
|
|
@@ -3059,7 +2874,7 @@ var R3Injector = /** @class */ (function () {
|
|
|
3059
2874
|
else {
|
|
3060
2875
|
token = provider;
|
|
3061
2876
|
multiRecord_1 = makeRecord(undefined, NOT_YET, true);
|
|
3062
|
-
multiRecord_1.factory = function () { return injectArgs(
|
|
2877
|
+
multiRecord_1.factory = function () { return injectArgs(multiRecord_1.multi); };
|
|
3063
2878
|
this.records.set(token, multiRecord_1);
|
|
3064
2879
|
}
|
|
3065
2880
|
token = provider;
|
|
@@ -3177,6 +2992,11 @@ function couldBeInjectableType(value) {
|
|
|
3177
2992
|
* Use of this source code is governed by an MIT-style license that can be
|
|
3178
2993
|
* found in the LICENSE file at https://angular.io/license
|
|
3179
2994
|
*/
|
|
2995
|
+
/**
|
|
2996
|
+
* @module
|
|
2997
|
+
* @description
|
|
2998
|
+
* The `di` module provides dependency injection container services.
|
|
2999
|
+
*/
|
|
3180
3000
|
|
|
3181
3001
|
/**
|
|
3182
3002
|
* @license
|
|
@@ -3230,9 +3050,7 @@ var ApplicationInitStatus = /** @class */ (function () {
|
|
|
3230
3050
|
});
|
|
3231
3051
|
}
|
|
3232
3052
|
/** @internal */
|
|
3233
|
-
|
|
3234
|
-
ApplicationInitStatus.prototype.runInitializers = /** @internal */
|
|
3235
|
-
function () {
|
|
3053
|
+
ApplicationInitStatus.prototype.runInitializers = function () {
|
|
3236
3054
|
var _this = this;
|
|
3237
3055
|
if (this.initialized) {
|
|
3238
3056
|
return;
|
|
@@ -3261,7 +3079,7 @@ var ApplicationInitStatus = /** @class */ (function () {
|
|
|
3261
3079
|
];
|
|
3262
3080
|
/** @nocollapse */
|
|
3263
3081
|
ApplicationInitStatus.ctorParameters = function () { return [
|
|
3264
|
-
{ type: Array, decorators: [{ type: Inject, args: [APP_INITIALIZER,] }, { type: Optional }
|
|
3082
|
+
{ type: Array, decorators: [{ type: Inject, args: [APP_INITIALIZER,] }, { type: Optional }] }
|
|
3265
3083
|
]; };
|
|
3266
3084
|
return ApplicationInitStatus;
|
|
3267
3085
|
}());
|
|
@@ -3339,18 +3157,13 @@ var Console = /** @class */ (function () {
|
|
|
3339
3157
|
console.log(message);
|
|
3340
3158
|
};
|
|
3341
3159
|
// Note: for reporting errors use `DOM.logError()` as it is platform specific
|
|
3342
|
-
|
|
3343
|
-
Console.prototype.warn =
|
|
3344
|
-
// Note: for reporting errors use `DOM.logError()` as it is platform specific
|
|
3345
|
-
function (message) {
|
|
3160
|
+
Console.prototype.warn = function (message) {
|
|
3346
3161
|
// tslint:disable-next-line:no-console
|
|
3347
3162
|
console.warn(message);
|
|
3348
3163
|
};
|
|
3349
3164
|
Console.decorators = [
|
|
3350
3165
|
{ type: Injectable }
|
|
3351
3166
|
];
|
|
3352
|
-
/** @nocollapse */
|
|
3353
|
-
Console.ctorParameters = function () { return []; };
|
|
3354
3167
|
return Console;
|
|
3355
3168
|
}());
|
|
3356
3169
|
|
|
@@ -3393,74 +3206,34 @@ var Compiler = /** @class */ (function () {
|
|
|
3393
3206
|
* Compiles the given NgModule and all of its components. All templates of the components listed
|
|
3394
3207
|
* in `entryComponents` have to be inlined.
|
|
3395
3208
|
*/
|
|
3396
|
-
|
|
3397
|
-
* Compiles the given NgModule and all of its components. All templates of the components listed
|
|
3398
|
-
* in `entryComponents` have to be inlined.
|
|
3399
|
-
*/
|
|
3400
|
-
Compiler.prototype.compileModuleSync = /**
|
|
3401
|
-
* Compiles the given NgModule and all of its components. All templates of the components listed
|
|
3402
|
-
* in `entryComponents` have to be inlined.
|
|
3403
|
-
*/
|
|
3404
|
-
function (moduleType) { throw _throwError(); };
|
|
3209
|
+
Compiler.prototype.compileModuleSync = function (moduleType) { throw _throwError(); };
|
|
3405
3210
|
/**
|
|
3406
3211
|
* Compiles the given NgModule and all of its components
|
|
3407
3212
|
*/
|
|
3408
|
-
|
|
3409
|
-
* Compiles the given NgModule and all of its components
|
|
3410
|
-
*/
|
|
3411
|
-
Compiler.prototype.compileModuleAsync = /**
|
|
3412
|
-
* Compiles the given NgModule and all of its components
|
|
3413
|
-
*/
|
|
3414
|
-
function (moduleType) { throw _throwError(); };
|
|
3213
|
+
Compiler.prototype.compileModuleAsync = function (moduleType) { throw _throwError(); };
|
|
3415
3214
|
/**
|
|
3416
3215
|
* Same as {@link #compileModuleSync} but also creates ComponentFactories for all components.
|
|
3417
3216
|
*/
|
|
3418
|
-
|
|
3419
|
-
* Same as {@link #compileModuleSync} but also creates ComponentFactories for all components.
|
|
3420
|
-
*/
|
|
3421
|
-
Compiler.prototype.compileModuleAndAllComponentsSync = /**
|
|
3422
|
-
* Same as {@link #compileModuleSync} but also creates ComponentFactories for all components.
|
|
3423
|
-
*/
|
|
3424
|
-
function (moduleType) {
|
|
3217
|
+
Compiler.prototype.compileModuleAndAllComponentsSync = function (moduleType) {
|
|
3425
3218
|
throw _throwError();
|
|
3426
3219
|
};
|
|
3427
3220
|
/**
|
|
3428
3221
|
* Same as {@link #compileModuleAsync} but also creates ComponentFactories for all components.
|
|
3429
3222
|
*/
|
|
3430
|
-
|
|
3431
|
-
* Same as {@link #compileModuleAsync} but also creates ComponentFactories for all components.
|
|
3432
|
-
*/
|
|
3433
|
-
Compiler.prototype.compileModuleAndAllComponentsAsync = /**
|
|
3434
|
-
* Same as {@link #compileModuleAsync} but also creates ComponentFactories for all components.
|
|
3435
|
-
*/
|
|
3436
|
-
function (moduleType) {
|
|
3223
|
+
Compiler.prototype.compileModuleAndAllComponentsAsync = function (moduleType) {
|
|
3437
3224
|
throw _throwError();
|
|
3438
3225
|
};
|
|
3439
3226
|
/**
|
|
3440
3227
|
* Clears all caches.
|
|
3441
3228
|
*/
|
|
3442
|
-
|
|
3443
|
-
* Clears all caches.
|
|
3444
|
-
*/
|
|
3445
|
-
Compiler.prototype.clearCache = /**
|
|
3446
|
-
* Clears all caches.
|
|
3447
|
-
*/
|
|
3448
|
-
function () { };
|
|
3229
|
+
Compiler.prototype.clearCache = function () { };
|
|
3449
3230
|
/**
|
|
3450
3231
|
* Clears the cache for the given component/ngModule.
|
|
3451
3232
|
*/
|
|
3452
|
-
|
|
3453
|
-
* Clears the cache for the given component/ngModule.
|
|
3454
|
-
*/
|
|
3455
|
-
Compiler.prototype.clearCacheFor = /**
|
|
3456
|
-
* Clears the cache for the given component/ngModule.
|
|
3457
|
-
*/
|
|
3458
|
-
function (type) { };
|
|
3233
|
+
Compiler.prototype.clearCacheFor = function (type) { };
|
|
3459
3234
|
Compiler.decorators = [
|
|
3460
3235
|
{ type: Injectable }
|
|
3461
3236
|
];
|
|
3462
|
-
/** @nocollapse */
|
|
3463
|
-
Compiler.ctorParameters = function () { return []; };
|
|
3464
3237
|
return Compiler;
|
|
3465
3238
|
}());
|
|
3466
3239
|
/**
|
|
@@ -3726,6 +3499,7 @@ var wtfEndTimeRange = wtfEnabled ? endTimeRange : function (r) { return null; };
|
|
|
3726
3499
|
/**
|
|
3727
3500
|
* Use by directives and components to emit custom Events.
|
|
3728
3501
|
*
|
|
3502
|
+
* @usageNotes
|
|
3729
3503
|
* ### Examples
|
|
3730
3504
|
*
|
|
3731
3505
|
* In the following example, `Zippy` alternatively emits `open` and `close` events when its
|
|
@@ -3764,6 +3538,8 @@ var wtfEndTimeRange = wtfEnabled ? endTimeRange : function (r) { return null; };
|
|
|
3764
3538
|
* <zippy (open)="onOpen($event)" (close)="onClose($event)"></zippy>
|
|
3765
3539
|
* ```
|
|
3766
3540
|
*
|
|
3541
|
+
* ### Notes
|
|
3542
|
+
*
|
|
3767
3543
|
* Uses Rx.Observable but provides an adapter to make it work as specified here:
|
|
3768
3544
|
* https://github.com/jhusain/observable-spec
|
|
3769
3545
|
*
|
|
@@ -3844,6 +3620,7 @@ var EventEmitter = /** @class */ (function (_super) {
|
|
|
3844
3620
|
* - link to runOutsideAngular/run (throughout this file!)
|
|
3845
3621
|
* -->
|
|
3846
3622
|
*
|
|
3623
|
+
* @usageNotes
|
|
3847
3624
|
* ### Example
|
|
3848
3625
|
*
|
|
3849
3626
|
* ```
|
|
@@ -3910,28 +3687,28 @@ var NgZone = /** @class */ (function () {
|
|
|
3910
3687
|
this.hasPendingMicrotasks = false;
|
|
3911
3688
|
this.hasPendingMacrotasks = false;
|
|
3912
3689
|
/**
|
|
3913
|
-
|
|
3914
|
-
|
|
3690
|
+
* Whether there are no outstanding microtasks or macrotasks.
|
|
3691
|
+
*/
|
|
3915
3692
|
this.isStable = true;
|
|
3916
3693
|
/**
|
|
3917
|
-
|
|
3918
|
-
|
|
3694
|
+
* Notifies when code enters Angular Zone. This gets fired first on VM Turn.
|
|
3695
|
+
*/
|
|
3919
3696
|
this.onUnstable = new EventEmitter(false);
|
|
3920
3697
|
/**
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3698
|
+
* Notifies when there is no more microtasks enqueued in the current VM Turn.
|
|
3699
|
+
* This is a hint for Angular to do change detection, which may enqueue more microtasks.
|
|
3700
|
+
* For this reason this event can fire multiple times per VM Turn.
|
|
3701
|
+
*/
|
|
3925
3702
|
this.onMicrotaskEmpty = new EventEmitter(false);
|
|
3926
3703
|
/**
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3704
|
+
* Notifies when the last `onMicrotaskEmpty` has run and there are no more microtasks, which
|
|
3705
|
+
* implies we are about to relinquish VM turn.
|
|
3706
|
+
* This event gets called just once.
|
|
3707
|
+
*/
|
|
3931
3708
|
this.onStable = new EventEmitter(false);
|
|
3932
3709
|
/**
|
|
3933
|
-
|
|
3934
|
-
|
|
3710
|
+
* Notifies that an error has been delivered.
|
|
3711
|
+
*/
|
|
3935
3712
|
this.onError = new EventEmitter(false);
|
|
3936
3713
|
if (typeof Zone == 'undefined') {
|
|
3937
3714
|
throw new Error("In this configuration Angular requires Zone.js");
|
|
@@ -3974,31 +3751,7 @@ var NgZone = /** @class */ (function () {
|
|
|
3974
3751
|
*
|
|
3975
3752
|
* If a synchronous error happens it will be rethrown and not reported via `onError`.
|
|
3976
3753
|
*/
|
|
3977
|
-
|
|
3978
|
-
* Executes the `fn` function synchronously within the Angular zone and returns value returned by
|
|
3979
|
-
* the function.
|
|
3980
|
-
*
|
|
3981
|
-
* Running functions via `run` allows you to reenter Angular zone from a task that was executed
|
|
3982
|
-
* outside of the Angular zone (typically started via {@link #runOutsideAngular}).
|
|
3983
|
-
*
|
|
3984
|
-
* Any future tasks or microtasks scheduled from within this function will continue executing from
|
|
3985
|
-
* within the Angular zone.
|
|
3986
|
-
*
|
|
3987
|
-
* If a synchronous error happens it will be rethrown and not reported via `onError`.
|
|
3988
|
-
*/
|
|
3989
|
-
NgZone.prototype.run = /**
|
|
3990
|
-
* Executes the `fn` function synchronously within the Angular zone and returns value returned by
|
|
3991
|
-
* the function.
|
|
3992
|
-
*
|
|
3993
|
-
* Running functions via `run` allows you to reenter Angular zone from a task that was executed
|
|
3994
|
-
* outside of the Angular zone (typically started via {@link #runOutsideAngular}).
|
|
3995
|
-
*
|
|
3996
|
-
* Any future tasks or microtasks scheduled from within this function will continue executing from
|
|
3997
|
-
* within the Angular zone.
|
|
3998
|
-
*
|
|
3999
|
-
* If a synchronous error happens it will be rethrown and not reported via `onError`.
|
|
4000
|
-
*/
|
|
4001
|
-
function (fn, applyThis, applyArgs) {
|
|
3754
|
+
NgZone.prototype.run = function (fn, applyThis, applyArgs) {
|
|
4002
3755
|
return this._inner.run(fn, applyThis, applyArgs);
|
|
4003
3756
|
};
|
|
4004
3757
|
/**
|
|
@@ -4013,31 +3766,7 @@ var NgZone = /** @class */ (function () {
|
|
|
4013
3766
|
*
|
|
4014
3767
|
* If a synchronous error happens it will be rethrown and not reported via `onError`.
|
|
4015
3768
|
*/
|
|
4016
|
-
|
|
4017
|
-
* Executes the `fn` function synchronously within the Angular zone as a task and returns value
|
|
4018
|
-
* returned by the function.
|
|
4019
|
-
*
|
|
4020
|
-
* Running functions via `run` allows you to reenter Angular zone from a task that was executed
|
|
4021
|
-
* outside of the Angular zone (typically started via {@link #runOutsideAngular}).
|
|
4022
|
-
*
|
|
4023
|
-
* Any future tasks or microtasks scheduled from within this function will continue executing from
|
|
4024
|
-
* within the Angular zone.
|
|
4025
|
-
*
|
|
4026
|
-
* If a synchronous error happens it will be rethrown and not reported via `onError`.
|
|
4027
|
-
*/
|
|
4028
|
-
NgZone.prototype.runTask = /**
|
|
4029
|
-
* Executes the `fn` function synchronously within the Angular zone as a task and returns value
|
|
4030
|
-
* returned by the function.
|
|
4031
|
-
*
|
|
4032
|
-
* Running functions via `run` allows you to reenter Angular zone from a task that was executed
|
|
4033
|
-
* outside of the Angular zone (typically started via {@link #runOutsideAngular}).
|
|
4034
|
-
*
|
|
4035
|
-
* Any future tasks or microtasks scheduled from within this function will continue executing from
|
|
4036
|
-
* within the Angular zone.
|
|
4037
|
-
*
|
|
4038
|
-
* If a synchronous error happens it will be rethrown and not reported via `onError`.
|
|
4039
|
-
*/
|
|
4040
|
-
function (fn, applyThis, applyArgs, name) {
|
|
3769
|
+
NgZone.prototype.runTask = function (fn, applyThis, applyArgs, name) {
|
|
4041
3770
|
var zone = this._inner;
|
|
4042
3771
|
var task = zone.scheduleEventTask('NgZoneEvent: ' + name, fn, EMPTY_PAYLOAD, noop, noop);
|
|
4043
3772
|
try {
|
|
@@ -4051,15 +3780,7 @@ var NgZone = /** @class */ (function () {
|
|
|
4051
3780
|
* Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not
|
|
4052
3781
|
* rethrown.
|
|
4053
3782
|
*/
|
|
4054
|
-
|
|
4055
|
-
* Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not
|
|
4056
|
-
* rethrown.
|
|
4057
|
-
*/
|
|
4058
|
-
NgZone.prototype.runGuarded = /**
|
|
4059
|
-
* Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not
|
|
4060
|
-
* rethrown.
|
|
4061
|
-
*/
|
|
4062
|
-
function (fn, applyThis, applyArgs) {
|
|
3783
|
+
NgZone.prototype.runGuarded = function (fn, applyThis, applyArgs) {
|
|
4063
3784
|
return this._inner.runGuarded(fn, applyThis, applyArgs);
|
|
4064
3785
|
};
|
|
4065
3786
|
/**
|
|
@@ -4075,33 +3796,7 @@ var NgZone = /** @class */ (function () {
|
|
|
4075
3796
|
*
|
|
4076
3797
|
* Use {@link #run} to reenter the Angular zone and do work that updates the application model.
|
|
4077
3798
|
*/
|
|
4078
|
-
|
|
4079
|
-
* Executes the `fn` function synchronously in Angular's parent zone and returns value returned by
|
|
4080
|
-
* the function.
|
|
4081
|
-
*
|
|
4082
|
-
* Running functions via {@link #runOutsideAngular} allows you to escape Angular's zone and do
|
|
4083
|
-
* work that
|
|
4084
|
-
* doesn't trigger Angular change-detection or is subject to Angular's error handling.
|
|
4085
|
-
*
|
|
4086
|
-
* Any future tasks or microtasks scheduled from within this function will continue executing from
|
|
4087
|
-
* outside of the Angular zone.
|
|
4088
|
-
*
|
|
4089
|
-
* Use {@link #run} to reenter the Angular zone and do work that updates the application model.
|
|
4090
|
-
*/
|
|
4091
|
-
NgZone.prototype.runOutsideAngular = /**
|
|
4092
|
-
* Executes the `fn` function synchronously in Angular's parent zone and returns value returned by
|
|
4093
|
-
* the function.
|
|
4094
|
-
*
|
|
4095
|
-
* Running functions via {@link #runOutsideAngular} allows you to escape Angular's zone and do
|
|
4096
|
-
* work that
|
|
4097
|
-
* doesn't trigger Angular change-detection or is subject to Angular's error handling.
|
|
4098
|
-
*
|
|
4099
|
-
* Any future tasks or microtasks scheduled from within this function will continue executing from
|
|
4100
|
-
* outside of the Angular zone.
|
|
4101
|
-
*
|
|
4102
|
-
* Use {@link #run} to reenter the Angular zone and do work that updates the application model.
|
|
4103
|
-
*/
|
|
4104
|
-
function (fn) {
|
|
3799
|
+
NgZone.prototype.runOutsideAngular = function (fn) {
|
|
4105
3800
|
return this._outer.run(fn);
|
|
4106
3801
|
};
|
|
4107
3802
|
return NgZone;
|
|
@@ -4222,11 +3917,11 @@ var Testability = /** @class */ (function () {
|
|
|
4222
3917
|
this._pendingCount = 0;
|
|
4223
3918
|
this._isZoneStable = true;
|
|
4224
3919
|
/**
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
3920
|
+
* Whether any work was done since the last 'whenStable' callback. This is
|
|
3921
|
+
* useful to detect if this could have potentially destabilized another
|
|
3922
|
+
* component while it is stabilizing.
|
|
3923
|
+
* @internal
|
|
3924
|
+
*/
|
|
4230
3925
|
this._didWork = false;
|
|
4231
3926
|
this._callbacks = [];
|
|
4232
3927
|
this._watchAngularEvents();
|
|
@@ -4256,15 +3951,7 @@ var Testability = /** @class */ (function () {
|
|
|
4256
3951
|
* Increases the number of pending request
|
|
4257
3952
|
* @deprecated pending requests are now tracked with zones.
|
|
4258
3953
|
*/
|
|
4259
|
-
|
|
4260
|
-
* Increases the number of pending request
|
|
4261
|
-
* @deprecated pending requests are now tracked with zones.
|
|
4262
|
-
*/
|
|
4263
|
-
Testability.prototype.increasePendingRequestCount = /**
|
|
4264
|
-
* Increases the number of pending request
|
|
4265
|
-
* @deprecated pending requests are now tracked with zones.
|
|
4266
|
-
*/
|
|
4267
|
-
function () {
|
|
3954
|
+
Testability.prototype.increasePendingRequestCount = function () {
|
|
4268
3955
|
this._pendingCount += 1;
|
|
4269
3956
|
this._didWork = true;
|
|
4270
3957
|
return this._pendingCount;
|
|
@@ -4273,15 +3960,7 @@ var Testability = /** @class */ (function () {
|
|
|
4273
3960
|
* Decreases the number of pending request
|
|
4274
3961
|
* @deprecated pending requests are now tracked with zones
|
|
4275
3962
|
*/
|
|
4276
|
-
|
|
4277
|
-
* Decreases the number of pending request
|
|
4278
|
-
* @deprecated pending requests are now tracked with zones
|
|
4279
|
-
*/
|
|
4280
|
-
Testability.prototype.decreasePendingRequestCount = /**
|
|
4281
|
-
* Decreases the number of pending request
|
|
4282
|
-
* @deprecated pending requests are now tracked with zones
|
|
4283
|
-
*/
|
|
4284
|
-
function () {
|
|
3963
|
+
Testability.prototype.decreasePendingRequestCount = function () {
|
|
4285
3964
|
this._pendingCount -= 1;
|
|
4286
3965
|
if (this._pendingCount < 0) {
|
|
4287
3966
|
throw new Error('pending async requests below zero');
|
|
@@ -4292,13 +3971,7 @@ var Testability = /** @class */ (function () {
|
|
|
4292
3971
|
/**
|
|
4293
3972
|
* Whether an associated application is stable
|
|
4294
3973
|
*/
|
|
4295
|
-
|
|
4296
|
-
* Whether an associated application is stable
|
|
4297
|
-
*/
|
|
4298
|
-
Testability.prototype.isStable = /**
|
|
4299
|
-
* Whether an associated application is stable
|
|
4300
|
-
*/
|
|
4301
|
-
function () {
|
|
3974
|
+
Testability.prototype.isStable = function () {
|
|
4302
3975
|
return this._isZoneStable && this._pendingCount === 0 && !this._ngZone.hasPendingMacrotasks;
|
|
4303
3976
|
};
|
|
4304
3977
|
Testability.prototype._runCallbacksIfReady = function () {
|
|
@@ -4307,7 +3980,7 @@ var Testability = /** @class */ (function () {
|
|
|
4307
3980
|
// Schedules the call backs in a new frame so that it is always async.
|
|
4308
3981
|
scheduleMicroTask(function () {
|
|
4309
3982
|
while (_this._callbacks.length !== 0) {
|
|
4310
|
-
var cb =
|
|
3983
|
+
var cb = _this._callbacks.pop();
|
|
4311
3984
|
clearTimeout(cb.timeoutId);
|
|
4312
3985
|
cb.doneCb(_this._didWork);
|
|
4313
3986
|
}
|
|
@@ -4368,31 +4041,7 @@ var Testability = /** @class */ (function () {
|
|
|
4368
4041
|
* pending macrotasks changes. If this callback returns true doneCb will not be invoked
|
|
4369
4042
|
* and no further updates will be issued.
|
|
4370
4043
|
*/
|
|
4371
|
-
|
|
4372
|
-
* Wait for the application to be stable with a timeout. If the timeout is reached before that
|
|
4373
|
-
* happens, the callback receives a list of the macro tasks that were pending, otherwise null.
|
|
4374
|
-
*
|
|
4375
|
-
* @param doneCb The callback to invoke when Angular is stable or the timeout expires
|
|
4376
|
-
* whichever comes first.
|
|
4377
|
-
* @param timeout Optional. The maximum time to wait for Angular to become stable. If not
|
|
4378
|
-
* specified, whenStable() will wait forever.
|
|
4379
|
-
* @param updateCb Optional. If specified, this callback will be invoked whenever the set of
|
|
4380
|
-
* pending macrotasks changes. If this callback returns true doneCb will not be invoked
|
|
4381
|
-
* and no further updates will be issued.
|
|
4382
|
-
*/
|
|
4383
|
-
Testability.prototype.whenStable = /**
|
|
4384
|
-
* Wait for the application to be stable with a timeout. If the timeout is reached before that
|
|
4385
|
-
* happens, the callback receives a list of the macro tasks that were pending, otherwise null.
|
|
4386
|
-
*
|
|
4387
|
-
* @param doneCb The callback to invoke when Angular is stable or the timeout expires
|
|
4388
|
-
* whichever comes first.
|
|
4389
|
-
* @param timeout Optional. The maximum time to wait for Angular to become stable. If not
|
|
4390
|
-
* specified, whenStable() will wait forever.
|
|
4391
|
-
* @param updateCb Optional. If specified, this callback will be invoked whenever the set of
|
|
4392
|
-
* pending macrotasks changes. If this callback returns true doneCb will not be invoked
|
|
4393
|
-
* and no further updates will be issued.
|
|
4394
|
-
*/
|
|
4395
|
-
function (doneCb, timeout, updateCb) {
|
|
4044
|
+
Testability.prototype.whenStable = function (doneCb, timeout, updateCb) {
|
|
4396
4045
|
if (updateCb && !this.taskTrackingZone) {
|
|
4397
4046
|
throw new Error('Task tracking zone is required when passing an update callback to ' +
|
|
4398
4047
|
'whenStable(). Is "zone.js/dist/task-tracking.js" loaded?');
|
|
@@ -4405,34 +4054,14 @@ var Testability = /** @class */ (function () {
|
|
|
4405
4054
|
* Get the number of pending requests
|
|
4406
4055
|
* @deprecated pending requests are now tracked with zones
|
|
4407
4056
|
*/
|
|
4408
|
-
|
|
4409
|
-
* Get the number of pending requests
|
|
4410
|
-
* @deprecated pending requests are now tracked with zones
|
|
4411
|
-
*/
|
|
4412
|
-
Testability.prototype.getPendingRequestCount = /**
|
|
4413
|
-
* Get the number of pending requests
|
|
4414
|
-
* @deprecated pending requests are now tracked with zones
|
|
4415
|
-
*/
|
|
4416
|
-
function () { return this._pendingCount; };
|
|
4057
|
+
Testability.prototype.getPendingRequestCount = function () { return this._pendingCount; };
|
|
4417
4058
|
/**
|
|
4418
4059
|
* Find providers by name
|
|
4419
4060
|
* @param using The root element to search from
|
|
4420
4061
|
* @param provider The name of binding variable
|
|
4421
4062
|
* @param exactMatch Whether using exactMatch
|
|
4422
4063
|
*/
|
|
4423
|
-
|
|
4424
|
-
* Find providers by name
|
|
4425
|
-
* @param using The root element to search from
|
|
4426
|
-
* @param provider The name of binding variable
|
|
4427
|
-
* @param exactMatch Whether using exactMatch
|
|
4428
|
-
*/
|
|
4429
|
-
Testability.prototype.findProviders = /**
|
|
4430
|
-
* Find providers by name
|
|
4431
|
-
* @param using The root element to search from
|
|
4432
|
-
* @param provider The name of binding variable
|
|
4433
|
-
* @param exactMatch Whether using exactMatch
|
|
4434
|
-
*/
|
|
4435
|
-
function (using, provider, exactMatch) {
|
|
4064
|
+
Testability.prototype.findProviders = function (using, provider, exactMatch) {
|
|
4436
4065
|
// TODO(juliemr): implement.
|
|
4437
4066
|
return [];
|
|
4438
4067
|
};
|
|
@@ -4441,7 +4070,7 @@ var Testability = /** @class */ (function () {
|
|
|
4441
4070
|
];
|
|
4442
4071
|
/** @nocollapse */
|
|
4443
4072
|
Testability.ctorParameters = function () { return [
|
|
4444
|
-
{ type: NgZone
|
|
4073
|
+
{ type: NgZone }
|
|
4445
4074
|
]; };
|
|
4446
4075
|
return Testability;
|
|
4447
4076
|
}());
|
|
@@ -4460,94 +4089,38 @@ var TestabilityRegistry = /** @class */ (function () {
|
|
|
4460
4089
|
* @param token token of application, root element
|
|
4461
4090
|
* @param testability Testability hook
|
|
4462
4091
|
*/
|
|
4463
|
-
|
|
4464
|
-
* Registers an application with a testability hook so that it can be tracked
|
|
4465
|
-
* @param token token of application, root element
|
|
4466
|
-
* @param testability Testability hook
|
|
4467
|
-
*/
|
|
4468
|
-
TestabilityRegistry.prototype.registerApplication = /**
|
|
4469
|
-
* Registers an application with a testability hook so that it can be tracked
|
|
4470
|
-
* @param token token of application, root element
|
|
4471
|
-
* @param testability Testability hook
|
|
4472
|
-
*/
|
|
4473
|
-
function (token, testability) {
|
|
4092
|
+
TestabilityRegistry.prototype.registerApplication = function (token, testability) {
|
|
4474
4093
|
this._applications.set(token, testability);
|
|
4475
4094
|
};
|
|
4476
4095
|
/**
|
|
4477
4096
|
* Unregisters an application.
|
|
4478
4097
|
* @param token token of application, root element
|
|
4479
4098
|
*/
|
|
4480
|
-
|
|
4481
|
-
* Unregisters an application.
|
|
4482
|
-
* @param token token of application, root element
|
|
4483
|
-
*/
|
|
4484
|
-
TestabilityRegistry.prototype.unregisterApplication = /**
|
|
4485
|
-
* Unregisters an application.
|
|
4486
|
-
* @param token token of application, root element
|
|
4487
|
-
*/
|
|
4488
|
-
function (token) { this._applications.delete(token); };
|
|
4099
|
+
TestabilityRegistry.prototype.unregisterApplication = function (token) { this._applications.delete(token); };
|
|
4489
4100
|
/**
|
|
4490
4101
|
* Unregisters all applications
|
|
4491
4102
|
*/
|
|
4492
|
-
|
|
4493
|
-
* Unregisters all applications
|
|
4494
|
-
*/
|
|
4495
|
-
TestabilityRegistry.prototype.unregisterAllApplications = /**
|
|
4496
|
-
* Unregisters all applications
|
|
4497
|
-
*/
|
|
4498
|
-
function () { this._applications.clear(); };
|
|
4103
|
+
TestabilityRegistry.prototype.unregisterAllApplications = function () { this._applications.clear(); };
|
|
4499
4104
|
/**
|
|
4500
4105
|
* Get a testability hook associated with the application
|
|
4501
4106
|
* @param elem root element
|
|
4502
4107
|
*/
|
|
4503
|
-
|
|
4504
|
-
* Get a testability hook associated with the application
|
|
4505
|
-
* @param elem root element
|
|
4506
|
-
*/
|
|
4507
|
-
TestabilityRegistry.prototype.getTestability = /**
|
|
4508
|
-
* Get a testability hook associated with the application
|
|
4509
|
-
* @param elem root element
|
|
4510
|
-
*/
|
|
4511
|
-
function (elem) { return this._applications.get(elem) || null; };
|
|
4108
|
+
TestabilityRegistry.prototype.getTestability = function (elem) { return this._applications.get(elem) || null; };
|
|
4512
4109
|
/**
|
|
4513
4110
|
* Get all registered testabilities
|
|
4514
4111
|
*/
|
|
4515
|
-
|
|
4516
|
-
* Get all registered testabilities
|
|
4517
|
-
*/
|
|
4518
|
-
TestabilityRegistry.prototype.getAllTestabilities = /**
|
|
4519
|
-
* Get all registered testabilities
|
|
4520
|
-
*/
|
|
4521
|
-
function () { return Array.from(this._applications.values()); };
|
|
4112
|
+
TestabilityRegistry.prototype.getAllTestabilities = function () { return Array.from(this._applications.values()); };
|
|
4522
4113
|
/**
|
|
4523
4114
|
* Get all registered applications(root elements)
|
|
4524
4115
|
*/
|
|
4525
|
-
|
|
4526
|
-
* Get all registered applications(root elements)
|
|
4527
|
-
*/
|
|
4528
|
-
TestabilityRegistry.prototype.getAllRootElements = /**
|
|
4529
|
-
* Get all registered applications(root elements)
|
|
4530
|
-
*/
|
|
4531
|
-
function () { return Array.from(this._applications.keys()); };
|
|
4116
|
+
TestabilityRegistry.prototype.getAllRootElements = function () { return Array.from(this._applications.keys()); };
|
|
4532
4117
|
/**
|
|
4533
4118
|
* Find testability of a node in the Tree
|
|
4534
4119
|
* @param elem node
|
|
4535
4120
|
* @param findInAncestors whether finding testability in ancestors if testability was not found in
|
|
4536
4121
|
* current node
|
|
4537
4122
|
*/
|
|
4538
|
-
|
|
4539
|
-
* Find testability of a node in the Tree
|
|
4540
|
-
* @param elem node
|
|
4541
|
-
* @param findInAncestors whether finding testability in ancestors if testability was not found in
|
|
4542
|
-
* current node
|
|
4543
|
-
*/
|
|
4544
|
-
TestabilityRegistry.prototype.findTestabilityInTree = /**
|
|
4545
|
-
* Find testability of a node in the Tree
|
|
4546
|
-
* @param elem node
|
|
4547
|
-
* @param findInAncestors whether finding testability in ancestors if testability was not found in
|
|
4548
|
-
* current node
|
|
4549
|
-
*/
|
|
4550
|
-
function (elem, findInAncestors) {
|
|
4123
|
+
TestabilityRegistry.prototype.findTestabilityInTree = function (elem, findInAncestors) {
|
|
4551
4124
|
if (findInAncestors === void 0) { findInAncestors = true; }
|
|
4552
4125
|
return _testabilityGetter.findTestabilityInTree(this, elem, findInAncestors);
|
|
4553
4126
|
};
|
|
@@ -4708,8 +4281,6 @@ function getPlatform() {
|
|
|
4708
4281
|
*
|
|
4709
4282
|
* A page's platform is initialized implicitly when a platform is created via a platform factory
|
|
4710
4283
|
* (e.g. {@link platformBrowser}), or explicitly by calling the {@link createPlatform} function.
|
|
4711
|
-
*
|
|
4712
|
-
*
|
|
4713
4284
|
*/
|
|
4714
4285
|
var PlatformRef = /** @class */ (function () {
|
|
4715
4286
|
/** @internal */
|
|
@@ -4723,7 +4294,8 @@ var PlatformRef = /** @class */ (function () {
|
|
|
4723
4294
|
* Creates an instance of an `@NgModule` for the given platform
|
|
4724
4295
|
* for offline compilation.
|
|
4725
4296
|
*
|
|
4726
|
-
*
|
|
4297
|
+
* @usageNotes
|
|
4298
|
+
* ### Simple Example
|
|
4727
4299
|
*
|
|
4728
4300
|
* ```typescript
|
|
4729
4301
|
* my_module.ts:
|
|
@@ -4742,53 +4314,7 @@ var PlatformRef = /** @class */ (function () {
|
|
|
4742
4314
|
*
|
|
4743
4315
|
* @experimental APIs related to application bootstrap are currently under review.
|
|
4744
4316
|
*/
|
|
4745
|
-
|
|
4746
|
-
* Creates an instance of an `@NgModule` for the given platform
|
|
4747
|
-
* for offline compilation.
|
|
4748
|
-
*
|
|
4749
|
-
* ## Simple Example
|
|
4750
|
-
*
|
|
4751
|
-
* ```typescript
|
|
4752
|
-
* my_module.ts:
|
|
4753
|
-
*
|
|
4754
|
-
* @NgModule({
|
|
4755
|
-
* imports: [BrowserModule]
|
|
4756
|
-
* })
|
|
4757
|
-
* class MyModule {}
|
|
4758
|
-
*
|
|
4759
|
-
* main.ts:
|
|
4760
|
-
* import {MyModuleNgFactory} from './my_module.ngfactory';
|
|
4761
|
-
* import {platformBrowser} from '@angular/platform-browser';
|
|
4762
|
-
*
|
|
4763
|
-
* let moduleRef = platformBrowser().bootstrapModuleFactory(MyModuleNgFactory);
|
|
4764
|
-
* ```
|
|
4765
|
-
*
|
|
4766
|
-
* @experimental APIs related to application bootstrap are currently under review.
|
|
4767
|
-
*/
|
|
4768
|
-
PlatformRef.prototype.bootstrapModuleFactory = /**
|
|
4769
|
-
* Creates an instance of an `@NgModule` for the given platform
|
|
4770
|
-
* for offline compilation.
|
|
4771
|
-
*
|
|
4772
|
-
* ## Simple Example
|
|
4773
|
-
*
|
|
4774
|
-
* ```typescript
|
|
4775
|
-
* my_module.ts:
|
|
4776
|
-
*
|
|
4777
|
-
* @NgModule({
|
|
4778
|
-
* imports: [BrowserModule]
|
|
4779
|
-
* })
|
|
4780
|
-
* class MyModule {}
|
|
4781
|
-
*
|
|
4782
|
-
* main.ts:
|
|
4783
|
-
* import {MyModuleNgFactory} from './my_module.ngfactory';
|
|
4784
|
-
* import {platformBrowser} from '@angular/platform-browser';
|
|
4785
|
-
*
|
|
4786
|
-
* let moduleRef = platformBrowser().bootstrapModuleFactory(MyModuleNgFactory);
|
|
4787
|
-
* ```
|
|
4788
|
-
*
|
|
4789
|
-
* @experimental APIs related to application bootstrap are currently under review.
|
|
4790
|
-
*/
|
|
4791
|
-
function (moduleFactory, options) {
|
|
4317
|
+
PlatformRef.prototype.bootstrapModuleFactory = function (moduleFactory, options) {
|
|
4792
4318
|
var _this = this;
|
|
4793
4319
|
// Note: We need to create the NgZone _before_ we instantiate the module,
|
|
4794
4320
|
// as instantiating the module creates some providers eagerly.
|
|
@@ -4807,10 +4333,8 @@ var PlatformRef = /** @class */ (function () {
|
|
|
4807
4333
|
throw new Error('No ErrorHandler. Is platform module (BrowserModule) included?');
|
|
4808
4334
|
}
|
|
4809
4335
|
moduleRef.onDestroy(function () { return remove(_this._modules, moduleRef); });
|
|
4810
|
-
ngZone.runOutsideAngular(function () {
|
|
4811
|
-
|
|
4812
|
-
});
|
|
4813
|
-
return _callAndReportToErrorHandler(exceptionHandler, (ngZone), function () {
|
|
4336
|
+
ngZone.runOutsideAngular(function () { return ngZone.onError.subscribe({ next: function (error) { exceptionHandler.handleError(error); } }); });
|
|
4337
|
+
return _callAndReportToErrorHandler(exceptionHandler, ngZone, function () {
|
|
4814
4338
|
var initStatus = moduleRef.injector.get(ApplicationInitStatus);
|
|
4815
4339
|
initStatus.runInitializers();
|
|
4816
4340
|
return initStatus.donePromise.then(function () {
|
|
@@ -4823,7 +4347,8 @@ var PlatformRef = /** @class */ (function () {
|
|
|
4823
4347
|
/**
|
|
4824
4348
|
* Creates an instance of an `@NgModule` for a given platform using the given runtime compiler.
|
|
4825
4349
|
*
|
|
4826
|
-
*
|
|
4350
|
+
* @usageNotes
|
|
4351
|
+
* ### Simple Example
|
|
4827
4352
|
*
|
|
4828
4353
|
* ```typescript
|
|
4829
4354
|
* @NgModule({
|
|
@@ -4835,37 +4360,7 @@ var PlatformRef = /** @class */ (function () {
|
|
|
4835
4360
|
* ```
|
|
4836
4361
|
*
|
|
4837
4362
|
*/
|
|
4838
|
-
|
|
4839
|
-
* Creates an instance of an `@NgModule` for a given platform using the given runtime compiler.
|
|
4840
|
-
*
|
|
4841
|
-
* ## Simple Example
|
|
4842
|
-
*
|
|
4843
|
-
* ```typescript
|
|
4844
|
-
* @NgModule({
|
|
4845
|
-
* imports: [BrowserModule]
|
|
4846
|
-
* })
|
|
4847
|
-
* class MyModule {}
|
|
4848
|
-
*
|
|
4849
|
-
* let moduleRef = platformBrowser().bootstrapModule(MyModule);
|
|
4850
|
-
* ```
|
|
4851
|
-
*
|
|
4852
|
-
*/
|
|
4853
|
-
PlatformRef.prototype.bootstrapModule = /**
|
|
4854
|
-
* Creates an instance of an `@NgModule` for a given platform using the given runtime compiler.
|
|
4855
|
-
*
|
|
4856
|
-
* ## Simple Example
|
|
4857
|
-
*
|
|
4858
|
-
* ```typescript
|
|
4859
|
-
* @NgModule({
|
|
4860
|
-
* imports: [BrowserModule]
|
|
4861
|
-
* })
|
|
4862
|
-
* class MyModule {}
|
|
4863
|
-
*
|
|
4864
|
-
* let moduleRef = platformBrowser().bootstrapModule(MyModule);
|
|
4865
|
-
* ```
|
|
4866
|
-
*
|
|
4867
|
-
*/
|
|
4868
|
-
function (moduleType, compilerOptions) {
|
|
4363
|
+
PlatformRef.prototype.bootstrapModule = function (moduleType, compilerOptions) {
|
|
4869
4364
|
var _this = this;
|
|
4870
4365
|
if (compilerOptions === void 0) { compilerOptions = []; }
|
|
4871
4366
|
var compilerFactory = this.injector.get(CompilerFactory);
|
|
@@ -4891,36 +4386,20 @@ var PlatformRef = /** @class */ (function () {
|
|
|
4891
4386
|
/**
|
|
4892
4387
|
* Register a listener to be called when the platform is disposed.
|
|
4893
4388
|
*/
|
|
4894
|
-
|
|
4895
|
-
* Register a listener to be called when the platform is disposed.
|
|
4896
|
-
*/
|
|
4897
|
-
PlatformRef.prototype.onDestroy = /**
|
|
4898
|
-
* Register a listener to be called when the platform is disposed.
|
|
4899
|
-
*/
|
|
4900
|
-
function (callback) { this._destroyListeners.push(callback); };
|
|
4389
|
+
PlatformRef.prototype.onDestroy = function (callback) { this._destroyListeners.push(callback); };
|
|
4901
4390
|
Object.defineProperty(PlatformRef.prototype, "injector", {
|
|
4902
4391
|
/**
|
|
4903
4392
|
* Retrieve the platform {@link Injector}, which is the parent injector for
|
|
4904
4393
|
* every Angular application on the page and provides singleton providers.
|
|
4905
4394
|
*/
|
|
4906
|
-
get:
|
|
4907
|
-
* Retrieve the platform {@link Injector}, which is the parent injector for
|
|
4908
|
-
* every Angular application on the page and provides singleton providers.
|
|
4909
|
-
*/
|
|
4910
|
-
function () { return this._injector; },
|
|
4395
|
+
get: function () { return this._injector; },
|
|
4911
4396
|
enumerable: true,
|
|
4912
4397
|
configurable: true
|
|
4913
4398
|
});
|
|
4914
4399
|
/**
|
|
4915
4400
|
* Destroy the Angular platform and all Angular applications on the page.
|
|
4916
4401
|
*/
|
|
4917
|
-
|
|
4918
|
-
* Destroy the Angular platform and all Angular applications on the page.
|
|
4919
|
-
*/
|
|
4920
|
-
PlatformRef.prototype.destroy = /**
|
|
4921
|
-
* Destroy the Angular platform and all Angular applications on the page.
|
|
4922
|
-
*/
|
|
4923
|
-
function () {
|
|
4402
|
+
PlatformRef.prototype.destroy = function () {
|
|
4924
4403
|
if (this._destroyed) {
|
|
4925
4404
|
throw new Error('The platform has already been destroyed!');
|
|
4926
4405
|
}
|
|
@@ -4938,7 +4417,7 @@ var PlatformRef = /** @class */ (function () {
|
|
|
4938
4417
|
];
|
|
4939
4418
|
/** @nocollapse */
|
|
4940
4419
|
PlatformRef.ctorParameters = function () { return [
|
|
4941
|
-
{ type: Injector
|
|
4420
|
+
{ type: Injector }
|
|
4942
4421
|
]; };
|
|
4943
4422
|
return PlatformRef;
|
|
4944
4423
|
}());
|
|
@@ -4982,8 +4461,6 @@ function optionsReducer(dst, objs) {
|
|
|
4982
4461
|
}
|
|
4983
4462
|
/**
|
|
4984
4463
|
* A reference to an Angular application running on a page.
|
|
4985
|
-
*
|
|
4986
|
-
*
|
|
4987
4464
|
*/
|
|
4988
4465
|
var ApplicationRef = /** @class */ (function () {
|
|
4989
4466
|
/** @internal */
|
|
@@ -5001,13 +4478,13 @@ var ApplicationRef = /** @class */ (function () {
|
|
|
5001
4478
|
this._enforceNoNewChanges = false;
|
|
5002
4479
|
this._stable = true;
|
|
5003
4480
|
/**
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
4481
|
+
* Get a list of component types registered to this application.
|
|
4482
|
+
* This list is populated even before the component is created.
|
|
4483
|
+
*/
|
|
5007
4484
|
this.componentTypes = [];
|
|
5008
4485
|
/**
|
|
5009
|
-
|
|
5010
|
-
|
|
4486
|
+
* Get a list of components registered to this application.
|
|
4487
|
+
*/
|
|
5011
4488
|
this.components = [];
|
|
5012
4489
|
this._enforceNoNewChanges = isDevMode();
|
|
5013
4490
|
this._zone.onMicrotaskEmpty.subscribe({ next: function () { _this._zone.run(function () { _this.tick(); }); } });
|
|
@@ -5055,49 +4532,20 @@ var ApplicationRef = /** @class */ (function () {
|
|
|
5055
4532
|
/**
|
|
5056
4533
|
* Bootstrap a new component at the root level of the application.
|
|
5057
4534
|
*
|
|
4535
|
+
* @usageNotes
|
|
5058
4536
|
* ### Bootstrap process
|
|
5059
4537
|
*
|
|
5060
4538
|
* When bootstrapping a new root component into an application, Angular mounts the
|
|
5061
|
-
* specified application component onto DOM elements identified by the
|
|
4539
|
+
* specified application component onto DOM elements identified by the componentType's
|
|
5062
4540
|
* selector and kicks off automatic change detection to finish initializing the component.
|
|
5063
4541
|
*
|
|
5064
4542
|
* Optionally, a component can be mounted onto a DOM element that does not match the
|
|
5065
|
-
*
|
|
4543
|
+
* componentType's selector.
|
|
5066
4544
|
*
|
|
5067
4545
|
* ### Example
|
|
5068
4546
|
* {@example core/ts/platform/platform.ts region='longform'}
|
|
5069
4547
|
*/
|
|
5070
|
-
|
|
5071
|
-
* Bootstrap a new component at the root level of the application.
|
|
5072
|
-
*
|
|
5073
|
-
* ### Bootstrap process
|
|
5074
|
-
*
|
|
5075
|
-
* When bootstrapping a new root component into an application, Angular mounts the
|
|
5076
|
-
* specified application component onto DOM elements identified by the [componentType]'s
|
|
5077
|
-
* selector and kicks off automatic change detection to finish initializing the component.
|
|
5078
|
-
*
|
|
5079
|
-
* Optionally, a component can be mounted onto a DOM element that does not match the
|
|
5080
|
-
* [componentType]'s selector.
|
|
5081
|
-
*
|
|
5082
|
-
* ### Example
|
|
5083
|
-
* {@example core/ts/platform/platform.ts region='longform'}
|
|
5084
|
-
*/
|
|
5085
|
-
ApplicationRef.prototype.bootstrap = /**
|
|
5086
|
-
* Bootstrap a new component at the root level of the application.
|
|
5087
|
-
*
|
|
5088
|
-
* ### Bootstrap process
|
|
5089
|
-
*
|
|
5090
|
-
* When bootstrapping a new root component into an application, Angular mounts the
|
|
5091
|
-
* specified application component onto DOM elements identified by the [componentType]'s
|
|
5092
|
-
* selector and kicks off automatic change detection to finish initializing the component.
|
|
5093
|
-
*
|
|
5094
|
-
* Optionally, a component can be mounted onto a DOM element that does not match the
|
|
5095
|
-
* [componentType]'s selector.
|
|
5096
|
-
*
|
|
5097
|
-
* ### Example
|
|
5098
|
-
* {@example core/ts/platform/platform.ts region='longform'}
|
|
5099
|
-
*/
|
|
5100
|
-
function (componentOrFactory, rootSelectorOrNode) {
|
|
4548
|
+
ApplicationRef.prototype.bootstrap = function (componentOrFactory, rootSelectorOrNode) {
|
|
5101
4549
|
var _this = this;
|
|
5102
4550
|
if (!this._initStatus.done) {
|
|
5103
4551
|
throw new Error('Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.');
|
|
@@ -5108,7 +4556,7 @@ var ApplicationRef = /** @class */ (function () {
|
|
|
5108
4556
|
}
|
|
5109
4557
|
else {
|
|
5110
4558
|
componentFactory =
|
|
5111
|
-
|
|
4559
|
+
this._componentFactoryResolver.resolveComponentFactory(componentOrFactory);
|
|
5112
4560
|
}
|
|
5113
4561
|
this.componentTypes.push(componentFactory.componentType);
|
|
5114
4562
|
// Create a factory associated with the current module if it's not bound to some other
|
|
@@ -5139,27 +4587,7 @@ var ApplicationRef = /** @class */ (function () {
|
|
|
5139
4587
|
* In this case, Angular throws an error, since an Angular application can only have one change
|
|
5140
4588
|
* detection pass during which all change detection must complete.
|
|
5141
4589
|
*/
|
|
5142
|
-
|
|
5143
|
-
* Invoke this method to explicitly process change detection and its side-effects.
|
|
5144
|
-
*
|
|
5145
|
-
* In development mode, `tick()` also performs a second change detection cycle to ensure that no
|
|
5146
|
-
* further changes are detected. If additional changes are picked up during this second cycle,
|
|
5147
|
-
* bindings in the app have side-effects that cannot be resolved in a single change detection
|
|
5148
|
-
* pass.
|
|
5149
|
-
* In this case, Angular throws an error, since an Angular application can only have one change
|
|
5150
|
-
* detection pass during which all change detection must complete.
|
|
5151
|
-
*/
|
|
5152
|
-
ApplicationRef.prototype.tick = /**
|
|
5153
|
-
* Invoke this method to explicitly process change detection and its side-effects.
|
|
5154
|
-
*
|
|
5155
|
-
* In development mode, `tick()` also performs a second change detection cycle to ensure that no
|
|
5156
|
-
* further changes are detected. If additional changes are picked up during this second cycle,
|
|
5157
|
-
* bindings in the app have side-effects that cannot be resolved in a single change detection
|
|
5158
|
-
* pass.
|
|
5159
|
-
* In this case, Angular throws an error, since an Angular application can only have one change
|
|
5160
|
-
* detection pass during which all change detection must complete.
|
|
5161
|
-
*/
|
|
5162
|
-
function () {
|
|
4590
|
+
ApplicationRef.prototype.tick = function () {
|
|
5163
4591
|
var _this = this;
|
|
5164
4592
|
if (this._runningTick) {
|
|
5165
4593
|
throw new Error('ApplicationRef.tick is called recursively');
|
|
@@ -5186,17 +4614,7 @@ var ApplicationRef = /** @class */ (function () {
|
|
|
5186
4614
|
* The view will be automatically detached when it is destroyed.
|
|
5187
4615
|
* This will throw if the view is already attached to a ViewContainer.
|
|
5188
4616
|
*/
|
|
5189
|
-
|
|
5190
|
-
* Attaches a view so that it will be dirty checked.
|
|
5191
|
-
* The view will be automatically detached when it is destroyed.
|
|
5192
|
-
* This will throw if the view is already attached to a ViewContainer.
|
|
5193
|
-
*/
|
|
5194
|
-
ApplicationRef.prototype.attachView = /**
|
|
5195
|
-
* Attaches a view so that it will be dirty checked.
|
|
5196
|
-
* The view will be automatically detached when it is destroyed.
|
|
5197
|
-
* This will throw if the view is already attached to a ViewContainer.
|
|
5198
|
-
*/
|
|
5199
|
-
function (viewRef) {
|
|
4617
|
+
ApplicationRef.prototype.attachView = function (viewRef) {
|
|
5200
4618
|
var view = viewRef;
|
|
5201
4619
|
this._views.push(view);
|
|
5202
4620
|
view.attachToAppRef(this);
|
|
@@ -5204,13 +4622,7 @@ var ApplicationRef = /** @class */ (function () {
|
|
|
5204
4622
|
/**
|
|
5205
4623
|
* Detaches a view from dirty checking again.
|
|
5206
4624
|
*/
|
|
5207
|
-
|
|
5208
|
-
* Detaches a view from dirty checking again.
|
|
5209
|
-
*/
|
|
5210
|
-
ApplicationRef.prototype.detachView = /**
|
|
5211
|
-
* Detaches a view from dirty checking again.
|
|
5212
|
-
*/
|
|
5213
|
-
function (viewRef) {
|
|
4625
|
+
ApplicationRef.prototype.detachView = function (viewRef) {
|
|
5214
4626
|
var view = viewRef;
|
|
5215
4627
|
remove(this._views, view);
|
|
5216
4628
|
view.detachFromAppRef();
|
|
@@ -5228,9 +4640,7 @@ var ApplicationRef = /** @class */ (function () {
|
|
|
5228
4640
|
remove(this.components, componentRef);
|
|
5229
4641
|
};
|
|
5230
4642
|
/** @internal */
|
|
5231
|
-
|
|
5232
|
-
ApplicationRef.prototype.ngOnDestroy = /** @internal */
|
|
5233
|
-
function () {
|
|
4643
|
+
ApplicationRef.prototype.ngOnDestroy = function () {
|
|
5234
4644
|
// TODO(alxhub): Dispose of the NgZone.
|
|
5235
4645
|
this._views.slice().forEach(function (view) { return view.destroy(); });
|
|
5236
4646
|
};
|
|
@@ -5238,10 +4648,7 @@ var ApplicationRef = /** @class */ (function () {
|
|
|
5238
4648
|
/**
|
|
5239
4649
|
* Returns the number of attached views.
|
|
5240
4650
|
*/
|
|
5241
|
-
get:
|
|
5242
|
-
* Returns the number of attached views.
|
|
5243
|
-
*/
|
|
5244
|
-
function () { return this._views.length; },
|
|
4651
|
+
get: function () { return this._views.length; },
|
|
5245
4652
|
enumerable: true,
|
|
5246
4653
|
configurable: true
|
|
5247
4654
|
});
|
|
@@ -5252,12 +4659,12 @@ var ApplicationRef = /** @class */ (function () {
|
|
|
5252
4659
|
];
|
|
5253
4660
|
/** @nocollapse */
|
|
5254
4661
|
ApplicationRef.ctorParameters = function () { return [
|
|
5255
|
-
{ type: NgZone
|
|
5256
|
-
{ type: Console
|
|
5257
|
-
{ type: Injector
|
|
5258
|
-
{ type: ErrorHandler
|
|
5259
|
-
{ type: ComponentFactoryResolver
|
|
5260
|
-
{ type: ApplicationInitStatus
|
|
4662
|
+
{ type: NgZone },
|
|
4663
|
+
{ type: Console },
|
|
4664
|
+
{ type: Injector },
|
|
4665
|
+
{ type: ErrorHandler },
|
|
4666
|
+
{ type: ComponentFactoryResolver },
|
|
4667
|
+
{ type: ApplicationInitStatus }
|
|
5261
4668
|
]; };
|
|
5262
4669
|
return ApplicationRef;
|
|
5263
4670
|
}());
|
|
@@ -5275,6 +4682,7 @@ function remove(list, el) {
|
|
|
5275
4682
|
* Use of this source code is governed by an MIT-style license that can be
|
|
5276
4683
|
* found in the LICENSE file at https://angular.io/license
|
|
5277
4684
|
*/
|
|
4685
|
+
// Public API for Zone
|
|
5278
4686
|
|
|
5279
4687
|
/**
|
|
5280
4688
|
* @license
|
|
@@ -5344,13 +4752,7 @@ var RendererFactory2 = /** @class */ (function () {
|
|
|
5344
4752
|
/**
|
|
5345
4753
|
* @experimental
|
|
5346
4754
|
*/
|
|
5347
|
-
/**
|
|
5348
|
-
* @experimental
|
|
5349
|
-
*/
|
|
5350
4755
|
|
|
5351
|
-
/**
|
|
5352
|
-
* @experimental
|
|
5353
|
-
*/
|
|
5354
4756
|
(function (RendererStyleFlags2) {
|
|
5355
4757
|
RendererStyleFlags2[RendererStyleFlags2["Important"] = 1] = "Important";
|
|
5356
4758
|
RendererStyleFlags2[RendererStyleFlags2["DashCase"] = 2] = "DashCase";
|
|
@@ -5371,6 +4773,7 @@ var Renderer2 = /** @class */ (function () {
|
|
|
5371
4773
|
* Use of this source code is governed by an MIT-style license that can be
|
|
5372
4774
|
* found in the LICENSE file at https://angular.io/license
|
|
5373
4775
|
*/
|
|
4776
|
+
// Public API for render
|
|
5374
4777
|
|
|
5375
4778
|
/**
|
|
5376
4779
|
* @license
|
|
@@ -5465,14 +4868,14 @@ function getModuleFactory(id) {
|
|
|
5465
4868
|
*
|
|
5466
4869
|
* NOTE: In the future this class will implement an `Observable` interface.
|
|
5467
4870
|
*
|
|
5468
|
-
*
|
|
4871
|
+
* @usageNotes
|
|
4872
|
+
* ### Example
|
|
5469
4873
|
* ```typescript
|
|
5470
4874
|
* @Component({...})
|
|
5471
4875
|
* class Container {
|
|
5472
4876
|
* @ViewChildren(Item) items:QueryList<Item>;
|
|
5473
4877
|
* }
|
|
5474
4878
|
* ```
|
|
5475
|
-
*
|
|
5476
4879
|
*/
|
|
5477
4880
|
var QueryList = /** @class */ (function () {
|
|
5478
4881
|
function QueryList() {
|
|
@@ -5485,86 +4888,38 @@ var QueryList = /** @class */ (function () {
|
|
|
5485
4888
|
* See
|
|
5486
4889
|
* [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)
|
|
5487
4890
|
*/
|
|
5488
|
-
|
|
5489
|
-
* See
|
|
5490
|
-
* [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)
|
|
5491
|
-
*/
|
|
5492
|
-
QueryList.prototype.map = /**
|
|
5493
|
-
* See
|
|
5494
|
-
* [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)
|
|
5495
|
-
*/
|
|
5496
|
-
function (fn) { return this._results.map(fn); };
|
|
4891
|
+
QueryList.prototype.map = function (fn) { return this._results.map(fn); };
|
|
5497
4892
|
/**
|
|
5498
4893
|
* See
|
|
5499
4894
|
* [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)
|
|
5500
4895
|
*/
|
|
5501
|
-
|
|
5502
|
-
* See
|
|
5503
|
-
* [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)
|
|
5504
|
-
*/
|
|
5505
|
-
QueryList.prototype.filter = /**
|
|
5506
|
-
* See
|
|
5507
|
-
* [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)
|
|
5508
|
-
*/
|
|
5509
|
-
function (fn) {
|
|
4896
|
+
QueryList.prototype.filter = function (fn) {
|
|
5510
4897
|
return this._results.filter(fn);
|
|
5511
4898
|
};
|
|
5512
4899
|
/**
|
|
5513
4900
|
* See
|
|
5514
4901
|
* [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
|
|
5515
4902
|
*/
|
|
5516
|
-
|
|
5517
|
-
* See
|
|
5518
|
-
* [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
|
|
5519
|
-
*/
|
|
5520
|
-
QueryList.prototype.find = /**
|
|
5521
|
-
* See
|
|
5522
|
-
* [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
|
|
5523
|
-
*/
|
|
5524
|
-
function (fn) {
|
|
4903
|
+
QueryList.prototype.find = function (fn) {
|
|
5525
4904
|
return this._results.find(fn);
|
|
5526
4905
|
};
|
|
5527
4906
|
/**
|
|
5528
4907
|
* See
|
|
5529
4908
|
* [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)
|
|
5530
4909
|
*/
|
|
5531
|
-
|
|
5532
|
-
* See
|
|
5533
|
-
* [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)
|
|
5534
|
-
*/
|
|
5535
|
-
QueryList.prototype.reduce = /**
|
|
5536
|
-
* See
|
|
5537
|
-
* [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)
|
|
5538
|
-
*/
|
|
5539
|
-
function (fn, init) {
|
|
4910
|
+
QueryList.prototype.reduce = function (fn, init) {
|
|
5540
4911
|
return this._results.reduce(fn, init);
|
|
5541
4912
|
};
|
|
5542
4913
|
/**
|
|
5543
4914
|
* See
|
|
5544
4915
|
* [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)
|
|
5545
4916
|
*/
|
|
5546
|
-
|
|
5547
|
-
* See
|
|
5548
|
-
* [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)
|
|
5549
|
-
*/
|
|
5550
|
-
QueryList.prototype.forEach = /**
|
|
5551
|
-
* See
|
|
5552
|
-
* [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)
|
|
5553
|
-
*/
|
|
5554
|
-
function (fn) { this._results.forEach(fn); };
|
|
4917
|
+
QueryList.prototype.forEach = function (fn) { this._results.forEach(fn); };
|
|
5555
4918
|
/**
|
|
5556
4919
|
* See
|
|
5557
4920
|
* [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)
|
|
5558
4921
|
*/
|
|
5559
|
-
|
|
5560
|
-
* See
|
|
5561
|
-
* [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)
|
|
5562
|
-
*/
|
|
5563
|
-
QueryList.prototype.some = /**
|
|
5564
|
-
* See
|
|
5565
|
-
* [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)
|
|
5566
|
-
*/
|
|
5567
|
-
function (fn) {
|
|
4922
|
+
QueryList.prototype.some = function (fn) {
|
|
5568
4923
|
return this._results.some(fn);
|
|
5569
4924
|
};
|
|
5570
4925
|
QueryList.prototype.toArray = function () { return this._results.slice(); };
|
|
@@ -5579,13 +4934,9 @@ var QueryList = /** @class */ (function () {
|
|
|
5579
4934
|
};
|
|
5580
4935
|
QueryList.prototype.notifyOnChanges = function () { this.changes.emit(this); };
|
|
5581
4936
|
/** internal */
|
|
4937
|
+
QueryList.prototype.setDirty = function () { this.dirty = true; };
|
|
5582
4938
|
/** internal */
|
|
5583
|
-
QueryList.prototype.
|
|
5584
|
-
function () { this.dirty = true; };
|
|
5585
|
-
/** internal */
|
|
5586
|
-
/** internal */
|
|
5587
|
-
QueryList.prototype.destroy = /** internal */
|
|
5588
|
-
function () {
|
|
4939
|
+
QueryList.prototype.destroy = function () {
|
|
5589
4940
|
this.changes.complete();
|
|
5590
4941
|
this.changes.unsubscribe();
|
|
5591
4942
|
};
|
|
@@ -5662,8 +5013,8 @@ var SystemJsNgModuleLoader = /** @class */ (function () {
|
|
|
5662
5013
|
];
|
|
5663
5014
|
/** @nocollapse */
|
|
5664
5015
|
SystemJsNgModuleLoader.ctorParameters = function () { return [
|
|
5665
|
-
{ type: Compiler
|
|
5666
|
-
{ type: SystemJsNgModuleLoaderConfig, decorators: [{ type: Optional }
|
|
5016
|
+
{ type: Compiler },
|
|
5017
|
+
{ type: SystemJsNgModuleLoaderConfig, decorators: [{ type: Optional }] }
|
|
5667
5018
|
]; };
|
|
5668
5019
|
return SystemJsNgModuleLoader;
|
|
5669
5020
|
}());
|
|
@@ -5766,9 +5117,10 @@ var ViewRef = /** @class */ (function (_super) {
|
|
|
5766
5117
|
*
|
|
5767
5118
|
* Properties of elements in a View can change, but the structure (number and order) of elements in
|
|
5768
5119
|
* a View cannot. Changing the structure of Elements can only be done by inserting, moving or
|
|
5769
|
-
* removing nested Views via a
|
|
5120
|
+
* removing nested Views via a `ViewContainerRef`. Each View can contain many View Containers.
|
|
5770
5121
|
* <!-- /TODO -->
|
|
5771
5122
|
*
|
|
5123
|
+
* @usageNotes
|
|
5772
5124
|
* ### Example
|
|
5773
5125
|
*
|
|
5774
5126
|
* Given this template...
|
|
@@ -5780,9 +5132,10 @@ var ViewRef = /** @class */ (function (_super) {
|
|
|
5780
5132
|
* </ul>
|
|
5781
5133
|
* ```
|
|
5782
5134
|
*
|
|
5783
|
-
* We have two
|
|
5135
|
+
* We have two `TemplateRef`s:
|
|
5136
|
+
*
|
|
5137
|
+
* Outer `TemplateRef`:
|
|
5784
5138
|
*
|
|
5785
|
-
* Outer {@link TemplateRef}:
|
|
5786
5139
|
* ```
|
|
5787
5140
|
* Count: {{items.length}}
|
|
5788
5141
|
* <ul>
|
|
@@ -5790,14 +5143,15 @@ var ViewRef = /** @class */ (function (_super) {
|
|
|
5790
5143
|
* </ul>
|
|
5791
5144
|
* ```
|
|
5792
5145
|
*
|
|
5793
|
-
* Inner
|
|
5146
|
+
* Inner `TemplateRef`:
|
|
5147
|
+
*
|
|
5794
5148
|
* ```
|
|
5795
5149
|
* <li>{{item}}</li>
|
|
5796
5150
|
* ```
|
|
5797
5151
|
*
|
|
5798
|
-
* Notice that the original template is broken down into two separate
|
|
5152
|
+
* Notice that the original template is broken down into two separate `TemplateRef`s.
|
|
5799
5153
|
*
|
|
5800
|
-
* The outer/inner
|
|
5154
|
+
* The outer/inner `TemplateRef`s are then assembled into views like so:
|
|
5801
5155
|
*
|
|
5802
5156
|
* ```
|
|
5803
5157
|
* <!-- ViewRef: outer-0 -->
|
|
@@ -5826,6 +5180,7 @@ var EmbeddedViewRef = /** @class */ (function (_super) {
|
|
|
5826
5180
|
* Use of this source code is governed by an MIT-style license that can be
|
|
5827
5181
|
* found in the LICENSE file at https://angular.io/license
|
|
5828
5182
|
*/
|
|
5183
|
+
// Public API for compiler
|
|
5829
5184
|
|
|
5830
5185
|
/**
|
|
5831
5186
|
* @license
|
|
@@ -6060,26 +5415,14 @@ var WrappedValue = /** @class */ (function () {
|
|
|
6060
5415
|
this.wrapped = value;
|
|
6061
5416
|
}
|
|
6062
5417
|
/** Creates a wrapped value. */
|
|
6063
|
-
|
|
6064
|
-
WrappedValue.wrap = /** Creates a wrapped value. */
|
|
6065
|
-
function (value) { return new WrappedValue(value); };
|
|
5418
|
+
WrappedValue.wrap = function (value) { return new WrappedValue(value); };
|
|
6066
5419
|
/**
|
|
6067
5420
|
* Returns the underlying value of a wrapped value.
|
|
6068
5421
|
* Returns the given `value` when it is not wrapped.
|
|
6069
5422
|
**/
|
|
6070
|
-
|
|
6071
|
-
* Returns the underlying value of a wrapped value.
|
|
6072
|
-
* Returns the given `value` when it is not wrapped.
|
|
6073
|
-
**/
|
|
6074
|
-
WrappedValue.unwrap = /**
|
|
6075
|
-
* Returns the underlying value of a wrapped value.
|
|
6076
|
-
* Returns the given `value` when it is not wrapped.
|
|
6077
|
-
**/
|
|
6078
|
-
function (value) { return WrappedValue.isWrapped(value) ? value.wrapped : value; };
|
|
5423
|
+
WrappedValue.unwrap = function (value) { return WrappedValue.isWrapped(value) ? value.wrapped : value; };
|
|
6079
5424
|
/** Returns true if `value` is a wrapped value. */
|
|
6080
|
-
|
|
6081
|
-
WrappedValue.isWrapped = /** Returns true if `value` is a wrapped value. */
|
|
6082
|
-
function (value) { return value instanceof WrappedValue; };
|
|
5425
|
+
WrappedValue.isWrapped = function (value) { return value instanceof WrappedValue; };
|
|
6083
5426
|
return WrappedValue;
|
|
6084
5427
|
}());
|
|
6085
5428
|
/**
|
|
@@ -6095,13 +5438,7 @@ var SimpleChange = /** @class */ (function () {
|
|
|
6095
5438
|
/**
|
|
6096
5439
|
* Check whether the new value is the first value assigned.
|
|
6097
5440
|
*/
|
|
6098
|
-
|
|
6099
|
-
* Check whether the new value is the first value assigned.
|
|
6100
|
-
*/
|
|
6101
|
-
SimpleChange.prototype.isFirstChange = /**
|
|
6102
|
-
* Check whether the new value is the first value assigned.
|
|
6103
|
-
*/
|
|
6104
|
-
function () { return this.firstChange; };
|
|
5441
|
+
SimpleChange.prototype.isFirstChange = function () { return this.firstChange; };
|
|
6105
5442
|
return SimpleChange;
|
|
6106
5443
|
}());
|
|
6107
5444
|
function isListLikeIterable(obj) {
|
|
@@ -6109,7 +5446,6 @@ function isListLikeIterable(obj) {
|
|
|
6109
5446
|
return false;
|
|
6110
5447
|
return Array.isArray(obj) ||
|
|
6111
5448
|
(!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]
|
|
6112
|
-
// JS Map are iterables but return entries as [k, v]
|
|
6113
5449
|
getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop
|
|
6114
5450
|
}
|
|
6115
5451
|
function areIterablesEqual(a, b, comparator) {
|
|
@@ -6201,7 +5537,7 @@ var DefaultIterableDiffer = /** @class */ (function () {
|
|
|
6201
5537
|
// Order: remove, add, move
|
|
6202
5538
|
var record = !nextRemove ||
|
|
6203
5539
|
nextIt &&
|
|
6204
|
-
|
|
5540
|
+
nextIt.currentIndex <
|
|
6205
5541
|
getPreviousIndex(nextRemove, addRemoveOffset, moveOffsets) ?
|
|
6206
5542
|
nextIt :
|
|
6207
5543
|
nextRemove;
|
|
@@ -6222,7 +5558,7 @@ var DefaultIterableDiffer = /** @class */ (function () {
|
|
|
6222
5558
|
if (!moveOffsets)
|
|
6223
5559
|
moveOffsets = [];
|
|
6224
5560
|
var localMovePreviousIndex = adjPreviousIndex - addRemoveOffset;
|
|
6225
|
-
var localCurrentIndex =
|
|
5561
|
+
var localCurrentIndex = currentIndex - addRemoveOffset;
|
|
6226
5562
|
if (localMovePreviousIndex != localCurrentIndex) {
|
|
6227
5563
|
for (var i = 0; i < localMovePreviousIndex; i++) {
|
|
6228
5564
|
var offset = i < moveOffsets.length ? moveOffsets[i] : (moveOffsets[i] = 0);
|
|
@@ -6342,10 +5678,7 @@ var DefaultIterableDiffer = /** @class */ (function () {
|
|
|
6342
5678
|
/* CollectionChanges is considered dirty if it has any additions, moves, removals, or identity
|
|
6343
5679
|
* changes.
|
|
6344
5680
|
*/
|
|
6345
|
-
get:
|
|
6346
|
-
* changes.
|
|
6347
|
-
*/
|
|
6348
|
-
function () {
|
|
5681
|
+
get: function () {
|
|
6349
5682
|
return this._additionsHead !== null || this._movesHead !== null ||
|
|
6350
5683
|
this._removalsHead !== null || this._identityChangesHead !== null;
|
|
6351
5684
|
},
|
|
@@ -6360,23 +5693,7 @@ var DefaultIterableDiffer = /** @class */ (function () {
|
|
|
6360
5693
|
*
|
|
6361
5694
|
* @internal
|
|
6362
5695
|
*/
|
|
6363
|
-
|
|
6364
|
-
* Reset the state of the change objects to show no changes. This means set previousKey to
|
|
6365
|
-
* currentKey, and clear all of the queues (additions, moves, removals).
|
|
6366
|
-
* Set the previousIndexes of moved and added items to their currentIndexes
|
|
6367
|
-
* Reset the list of additions, moves and removals
|
|
6368
|
-
*
|
|
6369
|
-
* @internal
|
|
6370
|
-
*/
|
|
6371
|
-
DefaultIterableDiffer.prototype._reset = /**
|
|
6372
|
-
* Reset the state of the change objects to show no changes. This means set previousKey to
|
|
6373
|
-
* currentKey, and clear all of the queues (additions, moves, removals).
|
|
6374
|
-
* Set the previousIndexes of moved and added items to their currentIndexes
|
|
6375
|
-
* Reset the list of additions, moves and removals
|
|
6376
|
-
*
|
|
6377
|
-
* @internal
|
|
6378
|
-
*/
|
|
6379
|
-
function () {
|
|
5696
|
+
DefaultIterableDiffer.prototype._reset = function () {
|
|
6380
5697
|
if (this.isDirty) {
|
|
6381
5698
|
var record = void 0;
|
|
6382
5699
|
var nextRecord = void 0;
|
|
@@ -6408,27 +5725,7 @@ var DefaultIterableDiffer = /** @class */ (function () {
|
|
|
6408
5725
|
*
|
|
6409
5726
|
* @internal
|
|
6410
5727
|
*/
|
|
6411
|
-
|
|
6412
|
-
* This is the core function which handles differences between collections.
|
|
6413
|
-
*
|
|
6414
|
-
* - `record` is the record which we saw at this position last time. If null then it is a new
|
|
6415
|
-
* item.
|
|
6416
|
-
* - `item` is the current item in the collection
|
|
6417
|
-
* - `index` is the position of the item in the collection
|
|
6418
|
-
*
|
|
6419
|
-
* @internal
|
|
6420
|
-
*/
|
|
6421
|
-
DefaultIterableDiffer.prototype._mismatch = /**
|
|
6422
|
-
* This is the core function which handles differences between collections.
|
|
6423
|
-
*
|
|
6424
|
-
* - `record` is the record which we saw at this position last time. If null then it is a new
|
|
6425
|
-
* item.
|
|
6426
|
-
* - `item` is the current item in the collection
|
|
6427
|
-
* - `index` is the position of the item in the collection
|
|
6428
|
-
*
|
|
6429
|
-
* @internal
|
|
6430
|
-
*/
|
|
6431
|
-
function (record, item, itemTrackBy, index) {
|
|
5728
|
+
DefaultIterableDiffer.prototype._mismatch = function (record, item, itemTrackBy, index) {
|
|
6432
5729
|
// The previous record after which we will append the current one.
|
|
6433
5730
|
var previousRecord;
|
|
6434
5731
|
if (record === null) {
|
|
@@ -6493,64 +5790,10 @@ var DefaultIterableDiffer = /** @class */ (function () {
|
|
|
6493
5790
|
*
|
|
6494
5791
|
* @internal
|
|
6495
5792
|
*/
|
|
6496
|
-
|
|
6497
|
-
* This check is only needed if an array contains duplicates. (Short circuit of nothing dirty)
|
|
6498
|
-
*
|
|
6499
|
-
* Use case: `[a, a]` => `[b, a, a]`
|
|
6500
|
-
*
|
|
6501
|
-
* If we did not have this check then the insertion of `b` would:
|
|
6502
|
-
* 1) evict first `a`
|
|
6503
|
-
* 2) insert `b` at `0` index.
|
|
6504
|
-
* 3) leave `a` at index `1` as is. <-- this is wrong!
|
|
6505
|
-
* 3) reinsert `a` at index 2. <-- this is wrong!
|
|
6506
|
-
*
|
|
6507
|
-
* The correct behavior is:
|
|
6508
|
-
* 1) evict first `a`
|
|
6509
|
-
* 2) insert `b` at `0` index.
|
|
6510
|
-
* 3) reinsert `a` at index 1.
|
|
6511
|
-
* 3) move `a` at from `1` to `2`.
|
|
6512
|
-
*
|
|
6513
|
-
*
|
|
6514
|
-
* Double check that we have not evicted a duplicate item. We need to check if the item type may
|
|
6515
|
-
* have already been removed:
|
|
6516
|
-
* The insertion of b will evict the first 'a'. If we don't reinsert it now it will be reinserted
|
|
6517
|
-
* at the end. Which will show up as the two 'a's switching position. This is incorrect, since a
|
|
6518
|
-
* better way to think of it is as insert of 'b' rather then switch 'a' with 'b' and then add 'a'
|
|
6519
|
-
* at the end.
|
|
6520
|
-
*
|
|
6521
|
-
* @internal
|
|
6522
|
-
*/
|
|
6523
|
-
DefaultIterableDiffer.prototype._verifyReinsertion = /**
|
|
6524
|
-
* This check is only needed if an array contains duplicates. (Short circuit of nothing dirty)
|
|
6525
|
-
*
|
|
6526
|
-
* Use case: `[a, a]` => `[b, a, a]`
|
|
6527
|
-
*
|
|
6528
|
-
* If we did not have this check then the insertion of `b` would:
|
|
6529
|
-
* 1) evict first `a`
|
|
6530
|
-
* 2) insert `b` at `0` index.
|
|
6531
|
-
* 3) leave `a` at index `1` as is. <-- this is wrong!
|
|
6532
|
-
* 3) reinsert `a` at index 2. <-- this is wrong!
|
|
6533
|
-
*
|
|
6534
|
-
* The correct behavior is:
|
|
6535
|
-
* 1) evict first `a`
|
|
6536
|
-
* 2) insert `b` at `0` index.
|
|
6537
|
-
* 3) reinsert `a` at index 1.
|
|
6538
|
-
* 3) move `a` at from `1` to `2`.
|
|
6539
|
-
*
|
|
6540
|
-
*
|
|
6541
|
-
* Double check that we have not evicted a duplicate item. We need to check if the item type may
|
|
6542
|
-
* have already been removed:
|
|
6543
|
-
* The insertion of b will evict the first 'a'. If we don't reinsert it now it will be reinserted
|
|
6544
|
-
* at the end. Which will show up as the two 'a's switching position. This is incorrect, since a
|
|
6545
|
-
* better way to think of it is as insert of 'b' rather then switch 'a' with 'b' and then add 'a'
|
|
6546
|
-
* at the end.
|
|
6547
|
-
*
|
|
6548
|
-
* @internal
|
|
6549
|
-
*/
|
|
6550
|
-
function (record, item, itemTrackBy, index) {
|
|
5793
|
+
DefaultIterableDiffer.prototype._verifyReinsertion = function (record, item, itemTrackBy, index) {
|
|
6551
5794
|
var reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);
|
|
6552
5795
|
if (reinsertRecord !== null) {
|
|
6553
|
-
record = this._reinsertAfter(reinsertRecord,
|
|
5796
|
+
record = this._reinsertAfter(reinsertRecord, record._prev, index);
|
|
6554
5797
|
}
|
|
6555
5798
|
else if (record.currentIndex != index) {
|
|
6556
5799
|
record.currentIndex = index;
|
|
@@ -6565,21 +5808,7 @@ var DefaultIterableDiffer = /** @class */ (function () {
|
|
|
6565
5808
|
*
|
|
6566
5809
|
* @internal
|
|
6567
5810
|
*/
|
|
6568
|
-
|
|
6569
|
-
* Get rid of any excess {@link IterableChangeRecord_}s from the previous collection
|
|
6570
|
-
*
|
|
6571
|
-
* - `record` The first excess {@link IterableChangeRecord_}.
|
|
6572
|
-
*
|
|
6573
|
-
* @internal
|
|
6574
|
-
*/
|
|
6575
|
-
DefaultIterableDiffer.prototype._truncate = /**
|
|
6576
|
-
* Get rid of any excess {@link IterableChangeRecord_}s from the previous collection
|
|
6577
|
-
*
|
|
6578
|
-
* - `record` The first excess {@link IterableChangeRecord_}.
|
|
6579
|
-
*
|
|
6580
|
-
* @internal
|
|
6581
|
-
*/
|
|
6582
|
-
function (record) {
|
|
5811
|
+
DefaultIterableDiffer.prototype._truncate = function (record) {
|
|
6583
5812
|
// Anything after that needs to be removed;
|
|
6584
5813
|
while (record !== null) {
|
|
6585
5814
|
var nextRecord = record._next;
|
|
@@ -6606,9 +5835,7 @@ var DefaultIterableDiffer = /** @class */ (function () {
|
|
|
6606
5835
|
}
|
|
6607
5836
|
};
|
|
6608
5837
|
/** @internal */
|
|
6609
|
-
|
|
6610
|
-
DefaultIterableDiffer.prototype._reinsertAfter = /** @internal */
|
|
6611
|
-
function (record, prevRecord, index) {
|
|
5838
|
+
DefaultIterableDiffer.prototype._reinsertAfter = function (record, prevRecord, index) {
|
|
6612
5839
|
if (this._unlinkedRecords !== null) {
|
|
6613
5840
|
this._unlinkedRecords.remove(record);
|
|
6614
5841
|
}
|
|
@@ -6631,18 +5858,14 @@ var DefaultIterableDiffer = /** @class */ (function () {
|
|
|
6631
5858
|
return record;
|
|
6632
5859
|
};
|
|
6633
5860
|
/** @internal */
|
|
6634
|
-
|
|
6635
|
-
DefaultIterableDiffer.prototype._moveAfter = /** @internal */
|
|
6636
|
-
function (record, prevRecord, index) {
|
|
5861
|
+
DefaultIterableDiffer.prototype._moveAfter = function (record, prevRecord, index) {
|
|
6637
5862
|
this._unlink(record);
|
|
6638
5863
|
this._insertAfter(record, prevRecord, index);
|
|
6639
5864
|
this._addToMoves(record, index);
|
|
6640
5865
|
return record;
|
|
6641
5866
|
};
|
|
6642
5867
|
/** @internal */
|
|
6643
|
-
|
|
6644
|
-
DefaultIterableDiffer.prototype._addAfter = /** @internal */
|
|
6645
|
-
function (record, prevRecord, index) {
|
|
5868
|
+
DefaultIterableDiffer.prototype._addAfter = function (record, prevRecord, index) {
|
|
6646
5869
|
this._insertAfter(record, prevRecord, index);
|
|
6647
5870
|
if (this._additionsTail === null) {
|
|
6648
5871
|
// TODO(vicb):
|
|
@@ -6658,9 +5881,7 @@ var DefaultIterableDiffer = /** @class */ (function () {
|
|
|
6658
5881
|
return record;
|
|
6659
5882
|
};
|
|
6660
5883
|
/** @internal */
|
|
6661
|
-
|
|
6662
|
-
DefaultIterableDiffer.prototype._insertAfter = /** @internal */
|
|
6663
|
-
function (record, prevRecord, index) {
|
|
5884
|
+
DefaultIterableDiffer.prototype._insertAfter = function (record, prevRecord, index) {
|
|
6664
5885
|
// TODO(vicb):
|
|
6665
5886
|
// assert(record != prevRecord);
|
|
6666
5887
|
// assert(record._next === null);
|
|
@@ -6691,15 +5912,11 @@ var DefaultIterableDiffer = /** @class */ (function () {
|
|
|
6691
5912
|
return record;
|
|
6692
5913
|
};
|
|
6693
5914
|
/** @internal */
|
|
6694
|
-
|
|
6695
|
-
DefaultIterableDiffer.prototype._remove = /** @internal */
|
|
6696
|
-
function (record) {
|
|
5915
|
+
DefaultIterableDiffer.prototype._remove = function (record) {
|
|
6697
5916
|
return this._addToRemovals(this._unlink(record));
|
|
6698
5917
|
};
|
|
6699
5918
|
/** @internal */
|
|
6700
|
-
|
|
6701
|
-
DefaultIterableDiffer.prototype._unlink = /** @internal */
|
|
6702
|
-
function (record) {
|
|
5919
|
+
DefaultIterableDiffer.prototype._unlink = function (record) {
|
|
6703
5920
|
if (this._linkedRecords !== null) {
|
|
6704
5921
|
this._linkedRecords.remove(record);
|
|
6705
5922
|
}
|
|
@@ -6723,9 +5940,7 @@ var DefaultIterableDiffer = /** @class */ (function () {
|
|
|
6723
5940
|
return record;
|
|
6724
5941
|
};
|
|
6725
5942
|
/** @internal */
|
|
6726
|
-
|
|
6727
|
-
DefaultIterableDiffer.prototype._addToMoves = /** @internal */
|
|
6728
|
-
function (record, toIndex) {
|
|
5943
|
+
DefaultIterableDiffer.prototype._addToMoves = function (record, toIndex) {
|
|
6729
5944
|
// TODO(vicb):
|
|
6730
5945
|
// assert(record._nextMoved === null);
|
|
6731
5946
|
if (record.previousIndex === toIndex) {
|
|
@@ -6766,9 +5981,7 @@ var DefaultIterableDiffer = /** @class */ (function () {
|
|
|
6766
5981
|
return record;
|
|
6767
5982
|
};
|
|
6768
5983
|
/** @internal */
|
|
6769
|
-
|
|
6770
|
-
DefaultIterableDiffer.prototype._addIdentityChange = /** @internal */
|
|
6771
|
-
function (record, item) {
|
|
5984
|
+
DefaultIterableDiffer.prototype._addIdentityChange = function (record, item) {
|
|
6772
5985
|
record.item = item;
|
|
6773
5986
|
if (this._identityChangesTail === null) {
|
|
6774
5987
|
this._identityChangesTail = this._identityChangesHead = record;
|
|
@@ -6822,26 +6035,13 @@ var _DuplicateItemRecordList = /** @class */ (function () {
|
|
|
6822
6035
|
*
|
|
6823
6036
|
* Note: by design all records in the list of duplicates hold the same value in record.item.
|
|
6824
6037
|
*/
|
|
6825
|
-
|
|
6826
|
-
* Append the record to the list of duplicates.
|
|
6827
|
-
*
|
|
6828
|
-
* Note: by design all records in the list of duplicates hold the same value in record.item.
|
|
6829
|
-
*/
|
|
6830
|
-
_DuplicateItemRecordList.prototype.add = /**
|
|
6831
|
-
* Append the record to the list of duplicates.
|
|
6832
|
-
*
|
|
6833
|
-
* Note: by design all records in the list of duplicates hold the same value in record.item.
|
|
6834
|
-
*/
|
|
6835
|
-
function (record) {
|
|
6038
|
+
_DuplicateItemRecordList.prototype.add = function (record) {
|
|
6836
6039
|
if (this._head === null) {
|
|
6837
6040
|
this._head = this._tail = record;
|
|
6838
6041
|
record._nextDup = null;
|
|
6839
6042
|
record._prevDup = null;
|
|
6840
6043
|
}
|
|
6841
6044
|
else {
|
|
6842
|
-
// TODO(vicb):
|
|
6843
|
-
// assert(record.item == _head.item ||
|
|
6844
|
-
// record.item is num && record.item.isNaN && _head.item is num && _head.item.isNaN);
|
|
6845
6045
|
// TODO(vicb):
|
|
6846
6046
|
// assert(record.item == _head.item ||
|
|
6847
6047
|
// record.item is num && record.item.isNaN && _head.item is num && _head.item.isNaN);
|
|
@@ -6853,15 +6053,10 @@ var _DuplicateItemRecordList = /** @class */ (function () {
|
|
|
6853
6053
|
};
|
|
6854
6054
|
// Returns a IterableChangeRecord_ having IterableChangeRecord_.trackById == trackById and
|
|
6855
6055
|
// IterableChangeRecord_.currentIndex >= atOrAfterIndex
|
|
6856
|
-
|
|
6857
|
-
// IterableChangeRecord_.currentIndex >= atOrAfterIndex
|
|
6858
|
-
_DuplicateItemRecordList.prototype.get =
|
|
6859
|
-
// Returns a IterableChangeRecord_ having IterableChangeRecord_.trackById == trackById and
|
|
6860
|
-
// IterableChangeRecord_.currentIndex >= atOrAfterIndex
|
|
6861
|
-
function (trackById, atOrAfterIndex) {
|
|
6056
|
+
_DuplicateItemRecordList.prototype.get = function (trackById, atOrAfterIndex) {
|
|
6862
6057
|
var record;
|
|
6863
6058
|
for (record = this._head; record !== null; record = record._nextDup) {
|
|
6864
|
-
if ((atOrAfterIndex === null || atOrAfterIndex <=
|
|
6059
|
+
if ((atOrAfterIndex === null || atOrAfterIndex <= record.currentIndex) &&
|
|
6865
6060
|
looseIdentical(record.trackById, trackById)) {
|
|
6866
6061
|
return record;
|
|
6867
6062
|
}
|
|
@@ -6873,17 +6068,7 @@ var _DuplicateItemRecordList = /** @class */ (function () {
|
|
|
6873
6068
|
*
|
|
6874
6069
|
* Returns whether the list of duplicates is empty.
|
|
6875
6070
|
*/
|
|
6876
|
-
|
|
6877
|
-
* Remove one {@link IterableChangeRecord_} from the list of duplicates.
|
|
6878
|
-
*
|
|
6879
|
-
* Returns whether the list of duplicates is empty.
|
|
6880
|
-
*/
|
|
6881
|
-
_DuplicateItemRecordList.prototype.remove = /**
|
|
6882
|
-
* Remove one {@link IterableChangeRecord_} from the list of duplicates.
|
|
6883
|
-
*
|
|
6884
|
-
* Returns whether the list of duplicates is empty.
|
|
6885
|
-
*/
|
|
6886
|
-
function (record) {
|
|
6071
|
+
_DuplicateItemRecordList.prototype.remove = function (record) {
|
|
6887
6072
|
// TODO(vicb):
|
|
6888
6073
|
// assert(() {
|
|
6889
6074
|
// // verify that the record being removed is in the list.
|
|
@@ -6930,21 +6115,7 @@ var _DuplicateMap = /** @class */ (function () {
|
|
|
6930
6115
|
* Use case: `[a, b, c, a, a]` if we are at index `3` which is the second `a` then asking if we
|
|
6931
6116
|
* have any more `a`s needs to return the second `a`.
|
|
6932
6117
|
*/
|
|
6933
|
-
|
|
6934
|
-
* Retrieve the `value` using key. Because the IterableChangeRecord_ value may be one which we
|
|
6935
|
-
* have already iterated over, we use the `atOrAfterIndex` to pretend it is not there.
|
|
6936
|
-
*
|
|
6937
|
-
* Use case: `[a, b, c, a, a]` if we are at index `3` which is the second `a` then asking if we
|
|
6938
|
-
* have any more `a`s needs to return the second `a`.
|
|
6939
|
-
*/
|
|
6940
|
-
_DuplicateMap.prototype.get = /**
|
|
6941
|
-
* Retrieve the `value` using key. Because the IterableChangeRecord_ value may be one which we
|
|
6942
|
-
* have already iterated over, we use the `atOrAfterIndex` to pretend it is not there.
|
|
6943
|
-
*
|
|
6944
|
-
* Use case: `[a, b, c, a, a]` if we are at index `3` which is the second `a` then asking if we
|
|
6945
|
-
* have any more `a`s needs to return the second `a`.
|
|
6946
|
-
*/
|
|
6947
|
-
function (trackById, atOrAfterIndex) {
|
|
6118
|
+
_DuplicateMap.prototype.get = function (trackById, atOrAfterIndex) {
|
|
6948
6119
|
var key = trackById;
|
|
6949
6120
|
var recordList = this.map.get(key);
|
|
6950
6121
|
return recordList ? recordList.get(trackById, atOrAfterIndex) : null;
|
|
@@ -6954,19 +6125,9 @@ var _DuplicateMap = /** @class */ (function () {
|
|
|
6954
6125
|
*
|
|
6955
6126
|
* The list of duplicates also is removed from the map if it gets empty.
|
|
6956
6127
|
*/
|
|
6957
|
-
|
|
6958
|
-
* Removes a {@link IterableChangeRecord_} from the list of duplicates.
|
|
6959
|
-
*
|
|
6960
|
-
* The list of duplicates also is removed from the map if it gets empty.
|
|
6961
|
-
*/
|
|
6962
|
-
_DuplicateMap.prototype.remove = /**
|
|
6963
|
-
* Removes a {@link IterableChangeRecord_} from the list of duplicates.
|
|
6964
|
-
*
|
|
6965
|
-
* The list of duplicates also is removed from the map if it gets empty.
|
|
6966
|
-
*/
|
|
6967
|
-
function (record) {
|
|
6128
|
+
_DuplicateMap.prototype.remove = function (record) {
|
|
6968
6129
|
var key = record.trackById;
|
|
6969
|
-
var recordList =
|
|
6130
|
+
var recordList = this.map.get(key);
|
|
6970
6131
|
// Remove the list of duplicates when it gets empty
|
|
6971
6132
|
if (recordList.remove(record)) {
|
|
6972
6133
|
this.map.delete(key);
|
|
@@ -7072,15 +6233,7 @@ var DefaultKeyValueDiffer = /** @class */ (function () {
|
|
|
7072
6233
|
* Check the current state of the map vs the previous.
|
|
7073
6234
|
* The algorithm is optimised for when the keys do no change.
|
|
7074
6235
|
*/
|
|
7075
|
-
|
|
7076
|
-
* Check the current state of the map vs the previous.
|
|
7077
|
-
* The algorithm is optimised for when the keys do no change.
|
|
7078
|
-
*/
|
|
7079
|
-
DefaultKeyValueDiffer.prototype.check = /**
|
|
7080
|
-
* Check the current state of the map vs the previous.
|
|
7081
|
-
* The algorithm is optimised for when the keys do no change.
|
|
7082
|
-
*/
|
|
7083
|
-
function (map) {
|
|
6236
|
+
DefaultKeyValueDiffer.prototype.check = function (map) {
|
|
7084
6237
|
var _this = this;
|
|
7085
6238
|
this._reset();
|
|
7086
6239
|
var insertBefore = this._mapHead;
|
|
@@ -7129,23 +6282,7 @@ var DefaultKeyValueDiffer = /** @class */ (function () {
|
|
|
7129
6282
|
* - This method updates `this._appendAfter`,
|
|
7130
6283
|
* - The return value is the new value for the insertion pointer.
|
|
7131
6284
|
*/
|
|
7132
|
-
|
|
7133
|
-
* Inserts a record before `before` or append at the end of the list when `before` is null.
|
|
7134
|
-
*
|
|
7135
|
-
* Notes:
|
|
7136
|
-
* - This method appends at `this._appendAfter`,
|
|
7137
|
-
* - This method updates `this._appendAfter`,
|
|
7138
|
-
* - The return value is the new value for the insertion pointer.
|
|
7139
|
-
*/
|
|
7140
|
-
DefaultKeyValueDiffer.prototype._insertBeforeOrAppend = /**
|
|
7141
|
-
* Inserts a record before `before` or append at the end of the list when `before` is null.
|
|
7142
|
-
*
|
|
7143
|
-
* Notes:
|
|
7144
|
-
* - This method appends at `this._appendAfter`,
|
|
7145
|
-
* - This method updates `this._appendAfter`,
|
|
7146
|
-
* - The return value is the new value for the insertion pointer.
|
|
7147
|
-
*/
|
|
7148
|
-
function (before, record) {
|
|
6285
|
+
DefaultKeyValueDiffer.prototype._insertBeforeOrAppend = function (before, record) {
|
|
7149
6286
|
if (before) {
|
|
7150
6287
|
var prev = before._prev;
|
|
7151
6288
|
record._next = before;
|
|
@@ -7172,7 +6309,7 @@ var DefaultKeyValueDiffer = /** @class */ (function () {
|
|
|
7172
6309
|
};
|
|
7173
6310
|
DefaultKeyValueDiffer.prototype._getOrCreateRecordForKey = function (key, value) {
|
|
7174
6311
|
if (this._records.has(key)) {
|
|
7175
|
-
var record_1 =
|
|
6312
|
+
var record_1 = this._records.get(key);
|
|
7176
6313
|
this._maybeAddToChanges(record_1, value);
|
|
7177
6314
|
var prev = record_1._prev;
|
|
7178
6315
|
var next = record_1._next;
|
|
@@ -7193,9 +6330,7 @@ var DefaultKeyValueDiffer = /** @class */ (function () {
|
|
|
7193
6330
|
return record;
|
|
7194
6331
|
};
|
|
7195
6332
|
/** @internal */
|
|
7196
|
-
|
|
7197
|
-
DefaultKeyValueDiffer.prototype._reset = /** @internal */
|
|
7198
|
-
function () {
|
|
6333
|
+
DefaultKeyValueDiffer.prototype._reset = function () {
|
|
7199
6334
|
if (this.isDirty) {
|
|
7200
6335
|
var record = void 0;
|
|
7201
6336
|
// let `_previousMapHead` contain the state of the map before the changes
|
|
@@ -7217,10 +6352,7 @@ var DefaultKeyValueDiffer = /** @class */ (function () {
|
|
|
7217
6352
|
}
|
|
7218
6353
|
};
|
|
7219
6354
|
// Add the record or a given key to the list of changes only when the value has actually changed
|
|
7220
|
-
|
|
7221
|
-
DefaultKeyValueDiffer.prototype._maybeAddToChanges =
|
|
7222
|
-
// Add the record or a given key to the list of changes only when the value has actually changed
|
|
7223
|
-
function (record, newValue) {
|
|
6355
|
+
DefaultKeyValueDiffer.prototype._maybeAddToChanges = function (record, newValue) {
|
|
7224
6356
|
if (!looseIdentical(newValue, record.currentValue)) {
|
|
7225
6357
|
record.previousValue = record.currentValue;
|
|
7226
6358
|
record.currentValue = newValue;
|
|
@@ -7246,9 +6378,7 @@ var DefaultKeyValueDiffer = /** @class */ (function () {
|
|
|
7246
6378
|
}
|
|
7247
6379
|
};
|
|
7248
6380
|
/** @internal */
|
|
7249
|
-
|
|
7250
|
-
DefaultKeyValueDiffer.prototype._forEach = /** @internal */
|
|
7251
|
-
function (obj, fn) {
|
|
6381
|
+
DefaultKeyValueDiffer.prototype._forEach = function (obj, fn) {
|
|
7252
6382
|
if (obj instanceof Map) {
|
|
7253
6383
|
obj.forEach(fn);
|
|
7254
6384
|
}
|
|
@@ -7306,12 +6436,13 @@ var IterableDiffers = /** @class */ (function () {
|
|
|
7306
6436
|
* inherited {@link IterableDiffers} instance with the provided factories and return a new
|
|
7307
6437
|
* {@link IterableDiffers} instance.
|
|
7308
6438
|
*
|
|
6439
|
+
* @usageNotes
|
|
6440
|
+
* ### Example
|
|
6441
|
+
*
|
|
7309
6442
|
* The following example shows how to extend an existing list of factories,
|
|
7310
6443
|
* which will only be applied to the injector for this component and its children.
|
|
7311
6444
|
* This step is all that's required to make a new {@link IterableDiffer} available.
|
|
7312
6445
|
*
|
|
7313
|
-
* ### Example
|
|
7314
|
-
*
|
|
7315
6446
|
* ```
|
|
7316
6447
|
* @Component({
|
|
7317
6448
|
* viewProviders: [
|
|
@@ -7320,45 +6451,7 @@ var IterableDiffers = /** @class */ (function () {
|
|
|
7320
6451
|
* })
|
|
7321
6452
|
* ```
|
|
7322
6453
|
*/
|
|
7323
|
-
|
|
7324
|
-
* Takes an array of {@link IterableDifferFactory} and returns a provider used to extend the
|
|
7325
|
-
* inherited {@link IterableDiffers} instance with the provided factories and return a new
|
|
7326
|
-
* {@link IterableDiffers} instance.
|
|
7327
|
-
*
|
|
7328
|
-
* The following example shows how to extend an existing list of factories,
|
|
7329
|
-
* which will only be applied to the injector for this component and its children.
|
|
7330
|
-
* This step is all that's required to make a new {@link IterableDiffer} available.
|
|
7331
|
-
*
|
|
7332
|
-
* ### Example
|
|
7333
|
-
*
|
|
7334
|
-
* ```
|
|
7335
|
-
* @Component({
|
|
7336
|
-
* viewProviders: [
|
|
7337
|
-
* IterableDiffers.extend([new ImmutableListDiffer()])
|
|
7338
|
-
* ]
|
|
7339
|
-
* })
|
|
7340
|
-
* ```
|
|
7341
|
-
*/
|
|
7342
|
-
IterableDiffers.extend = /**
|
|
7343
|
-
* Takes an array of {@link IterableDifferFactory} and returns a provider used to extend the
|
|
7344
|
-
* inherited {@link IterableDiffers} instance with the provided factories and return a new
|
|
7345
|
-
* {@link IterableDiffers} instance.
|
|
7346
|
-
*
|
|
7347
|
-
* The following example shows how to extend an existing list of factories,
|
|
7348
|
-
* which will only be applied to the injector for this component and its children.
|
|
7349
|
-
* This step is all that's required to make a new {@link IterableDiffer} available.
|
|
7350
|
-
*
|
|
7351
|
-
* ### Example
|
|
7352
|
-
*
|
|
7353
|
-
* ```
|
|
7354
|
-
* @Component({
|
|
7355
|
-
* viewProviders: [
|
|
7356
|
-
* IterableDiffers.extend([new ImmutableListDiffer()])
|
|
7357
|
-
* ]
|
|
7358
|
-
* })
|
|
7359
|
-
* ```
|
|
7360
|
-
*/
|
|
7361
|
-
function (factories) {
|
|
6454
|
+
IterableDiffers.extend = function (factories) {
|
|
7362
6455
|
return {
|
|
7363
6456
|
provide: IterableDiffers,
|
|
7364
6457
|
useFactory: function (parent) {
|
|
@@ -7420,12 +6513,13 @@ var KeyValueDiffers = /** @class */ (function () {
|
|
|
7420
6513
|
* inherited {@link KeyValueDiffers} instance with the provided factories and return a new
|
|
7421
6514
|
* {@link KeyValueDiffers} instance.
|
|
7422
6515
|
*
|
|
6516
|
+
* @usageNotes
|
|
6517
|
+
* ### Example
|
|
6518
|
+
*
|
|
7423
6519
|
* The following example shows how to extend an existing list of factories,
|
|
7424
6520
|
* which will only be applied to the injector for this component and its children.
|
|
7425
6521
|
* This step is all that's required to make a new {@link KeyValueDiffer} available.
|
|
7426
6522
|
*
|
|
7427
|
-
* ### Example
|
|
7428
|
-
*
|
|
7429
6523
|
* ```
|
|
7430
6524
|
* @Component({
|
|
7431
6525
|
* viewProviders: [
|
|
@@ -7434,45 +6528,7 @@ var KeyValueDiffers = /** @class */ (function () {
|
|
|
7434
6528
|
* })
|
|
7435
6529
|
* ```
|
|
7436
6530
|
*/
|
|
7437
|
-
|
|
7438
|
-
* Takes an array of {@link KeyValueDifferFactory} and returns a provider used to extend the
|
|
7439
|
-
* inherited {@link KeyValueDiffers} instance with the provided factories and return a new
|
|
7440
|
-
* {@link KeyValueDiffers} instance.
|
|
7441
|
-
*
|
|
7442
|
-
* The following example shows how to extend an existing list of factories,
|
|
7443
|
-
* which will only be applied to the injector for this component and its children.
|
|
7444
|
-
* This step is all that's required to make a new {@link KeyValueDiffer} available.
|
|
7445
|
-
*
|
|
7446
|
-
* ### Example
|
|
7447
|
-
*
|
|
7448
|
-
* ```
|
|
7449
|
-
* @Component({
|
|
7450
|
-
* viewProviders: [
|
|
7451
|
-
* KeyValueDiffers.extend([new ImmutableMapDiffer()])
|
|
7452
|
-
* ]
|
|
7453
|
-
* })
|
|
7454
|
-
* ```
|
|
7455
|
-
*/
|
|
7456
|
-
KeyValueDiffers.extend = /**
|
|
7457
|
-
* Takes an array of {@link KeyValueDifferFactory} and returns a provider used to extend the
|
|
7458
|
-
* inherited {@link KeyValueDiffers} instance with the provided factories and return a new
|
|
7459
|
-
* {@link KeyValueDiffers} instance.
|
|
7460
|
-
*
|
|
7461
|
-
* The following example shows how to extend an existing list of factories,
|
|
7462
|
-
* which will only be applied to the injector for this component and its children.
|
|
7463
|
-
* This step is all that's required to make a new {@link KeyValueDiffer} available.
|
|
7464
|
-
*
|
|
7465
|
-
* ### Example
|
|
7466
|
-
*
|
|
7467
|
-
* ```
|
|
7468
|
-
* @Component({
|
|
7469
|
-
* viewProviders: [
|
|
7470
|
-
* KeyValueDiffers.extend([new ImmutableMapDiffer()])
|
|
7471
|
-
* ]
|
|
7472
|
-
* })
|
|
7473
|
-
* ```
|
|
7474
|
-
*/
|
|
7475
|
-
function (factories) {
|
|
6531
|
+
KeyValueDiffers.extend = function (factories) {
|
|
7476
6532
|
return {
|
|
7477
6533
|
provide: KeyValueDiffers,
|
|
7478
6534
|
useFactory: function (parent) {
|
|
@@ -7522,6 +6578,11 @@ var defaultKeyValueDiffers = new KeyValueDiffers(keyValDiff);
|
|
|
7522
6578
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7523
6579
|
* found in the LICENSE file at https://angular.io/license
|
|
7524
6580
|
*/
|
|
6581
|
+
/**
|
|
6582
|
+
* @module
|
|
6583
|
+
* @description
|
|
6584
|
+
* Change detection enables data binding in Angular.
|
|
6585
|
+
*/
|
|
7525
6586
|
|
|
7526
6587
|
/**
|
|
7527
6588
|
* @license
|
|
@@ -7556,8 +6617,9 @@ var platformCore = createPlatformFactory(null, 'core', _CORE_PLATFORM_PROVIDERS)
|
|
|
7556
6617
|
* It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,
|
|
7557
6618
|
* DecimalPipe and PercentPipe) and by ICU expressions.
|
|
7558
6619
|
*
|
|
7559
|
-
* See the
|
|
6620
|
+
* See the [i18n guide](guide/i18n#setting-up-locale) for more information.
|
|
7560
6621
|
*
|
|
6622
|
+
* @usageNotes
|
|
7561
6623
|
* ### Example
|
|
7562
6624
|
*
|
|
7563
6625
|
* ```typescript
|
|
@@ -7577,8 +6639,9 @@ var LOCALE_ID = new InjectionToken('LocaleId');
|
|
|
7577
6639
|
* Use this token at bootstrap to provide the content of your translation file (`xtb`,
|
|
7578
6640
|
* `xlf` or `xlf2`) when you want to translate your application in another language.
|
|
7579
6641
|
*
|
|
7580
|
-
* See the
|
|
6642
|
+
* See the [i18n guide](guide/i18n#merge) for more information.
|
|
7581
6643
|
*
|
|
6644
|
+
* @usageNotes
|
|
7582
6645
|
* ### Example
|
|
7583
6646
|
*
|
|
7584
6647
|
* ```typescript
|
|
@@ -7601,8 +6664,9 @@ var TRANSLATIONS = new InjectionToken('Translations');
|
|
|
7601
6664
|
* Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`,
|
|
7602
6665
|
* `xlf` or `xlf2`.
|
|
7603
6666
|
*
|
|
7604
|
-
* See the
|
|
6667
|
+
* See the [i18n guide](guide/i18n#merge) for more information.
|
|
7605
6668
|
*
|
|
6669
|
+
* @usageNotes
|
|
7606
6670
|
* ### Example
|
|
7607
6671
|
*
|
|
7608
6672
|
* ```typescript
|
|
@@ -7625,30 +6689,9 @@ var TRANSLATIONS_FORMAT = new InjectionToken('TranslationsFormat');
|
|
|
7625
6689
|
* - Warning (default): show a warning in the console and/or shell.
|
|
7626
6690
|
* - Ignore: do nothing.
|
|
7627
6691
|
*
|
|
7628
|
-
* See the
|
|
7629
|
-
*
|
|
7630
|
-
* ### Example
|
|
7631
|
-
* ```typescript
|
|
7632
|
-
* import { MissingTranslationStrategy } from '@angular/core';
|
|
7633
|
-
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
7634
|
-
* import { AppModule } from './app/app.module';
|
|
7635
|
-
*
|
|
7636
|
-
* platformBrowserDynamic().bootstrapModule(AppModule, {
|
|
7637
|
-
* missingTranslation: MissingTranslationStrategy.Error
|
|
7638
|
-
* });
|
|
7639
|
-
* ```
|
|
7640
|
-
*
|
|
7641
|
-
* @experimental i18n support is experimental.
|
|
7642
|
-
*/
|
|
7643
|
-
/**
|
|
7644
|
-
* Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy
|
|
7645
|
-
* that the compiler should use in case of missing translations:
|
|
7646
|
-
* - Error: throw if you have missing translations.
|
|
7647
|
-
* - Warning (default): show a warning in the console and/or shell.
|
|
7648
|
-
* - Ignore: do nothing.
|
|
7649
|
-
*
|
|
7650
|
-
* See the {@linkDocs guide/i18n#missing-translation i18n guide} for more information.
|
|
6692
|
+
* See the [i18n guide](guide/i18n#missing-translation) for more information.
|
|
7651
6693
|
*
|
|
6694
|
+
* @usageNotes
|
|
7652
6695
|
* ### Example
|
|
7653
6696
|
* ```typescript
|
|
7654
6697
|
* import { MissingTranslationStrategy } from '@angular/core';
|
|
@@ -7663,28 +6706,6 @@ var TRANSLATIONS_FORMAT = new InjectionToken('TranslationsFormat');
|
|
|
7663
6706
|
* @experimental i18n support is experimental.
|
|
7664
6707
|
*/
|
|
7665
6708
|
|
|
7666
|
-
/**
|
|
7667
|
-
* Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy
|
|
7668
|
-
* that the compiler should use in case of missing translations:
|
|
7669
|
-
* - Error: throw if you have missing translations.
|
|
7670
|
-
* - Warning (default): show a warning in the console and/or shell.
|
|
7671
|
-
* - Ignore: do nothing.
|
|
7672
|
-
*
|
|
7673
|
-
* See the {@linkDocs guide/i18n#missing-translation i18n guide} for more information.
|
|
7674
|
-
*
|
|
7675
|
-
* ### Example
|
|
7676
|
-
* ```typescript
|
|
7677
|
-
* import { MissingTranslationStrategy } from '@angular/core';
|
|
7678
|
-
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
7679
|
-
* import { AppModule } from './app/app.module';
|
|
7680
|
-
*
|
|
7681
|
-
* platformBrowserDynamic().bootstrapModule(AppModule, {
|
|
7682
|
-
* missingTranslation: MissingTranslationStrategy.Error
|
|
7683
|
-
* });
|
|
7684
|
-
* ```
|
|
7685
|
-
*
|
|
7686
|
-
* @experimental i18n support is experimental.
|
|
7687
|
-
*/
|
|
7688
6709
|
(function (MissingTranslationStrategy) {
|
|
7689
6710
|
MissingTranslationStrategy[MissingTranslationStrategy["Error"] = 0] = "Error";
|
|
7690
6711
|
MissingTranslationStrategy[MissingTranslationStrategy["Warning"] = 1] = "Warning";
|
|
@@ -7736,7 +6757,7 @@ var ApplicationModule = /** @class */ (function () {
|
|
|
7736
6757
|
];
|
|
7737
6758
|
/** @nocollapse */
|
|
7738
6759
|
ApplicationModule.ctorParameters = function () { return [
|
|
7739
|
-
{ type: ApplicationRef
|
|
6760
|
+
{ type: ApplicationRef }
|
|
7740
6761
|
]; };
|
|
7741
6762
|
return ApplicationModule;
|
|
7742
6763
|
}());
|
|
@@ -7796,17 +6817,7 @@ var InertBodyHelper = /** @class */ (function () {
|
|
|
7796
6817
|
* See
|
|
7797
6818
|
* https://github.com/cure53/DOMPurify/blob/a992d3a75031cb8bb032e5ea8399ba972bdf9a65/src/purify.js#L439-L449
|
|
7798
6819
|
*/
|
|
7799
|
-
|
|
7800
|
-
* Use XHR to create and fill an inert body element (on Safari 10.1)
|
|
7801
|
-
* See
|
|
7802
|
-
* https://github.com/cure53/DOMPurify/blob/a992d3a75031cb8bb032e5ea8399ba972bdf9a65/src/purify.js#L439-L449
|
|
7803
|
-
*/
|
|
7804
|
-
InertBodyHelper.prototype.getInertBodyElement_XHR = /**
|
|
7805
|
-
* Use XHR to create and fill an inert body element (on Safari 10.1)
|
|
7806
|
-
* See
|
|
7807
|
-
* https://github.com/cure53/DOMPurify/blob/a992d3a75031cb8bb032e5ea8399ba972bdf9a65/src/purify.js#L439-L449
|
|
7808
|
-
*/
|
|
7809
|
-
function (html) {
|
|
6820
|
+
InertBodyHelper.prototype.getInertBodyElement_XHR = function (html) {
|
|
7810
6821
|
// We add these extra elements to ensure that the rest of the content is parsed as expected
|
|
7811
6822
|
// e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the
|
|
7812
6823
|
// `<head>` tag.
|
|
@@ -7822,7 +6833,7 @@ var InertBodyHelper = /** @class */ (function () {
|
|
|
7822
6833
|
xhr.open('GET', 'data:text/html;charset=utf-8,' + html, false);
|
|
7823
6834
|
xhr.send(null);
|
|
7824
6835
|
var body = xhr.response.body;
|
|
7825
|
-
body.removeChild(
|
|
6836
|
+
body.removeChild(body.firstChild);
|
|
7826
6837
|
return body;
|
|
7827
6838
|
};
|
|
7828
6839
|
/**
|
|
@@ -7830,17 +6841,7 @@ var InertBodyHelper = /** @class */ (function () {
|
|
|
7830
6841
|
* See https://github.com/cure53/DOMPurify/releases/tag/0.6.7
|
|
7831
6842
|
*
|
|
7832
6843
|
*/
|
|
7833
|
-
|
|
7834
|
-
* Use DOMParser to create and fill an inert body element (on Firefox)
|
|
7835
|
-
* See https://github.com/cure53/DOMPurify/releases/tag/0.6.7
|
|
7836
|
-
*
|
|
7837
|
-
*/
|
|
7838
|
-
InertBodyHelper.prototype.getInertBodyElement_DOMParser = /**
|
|
7839
|
-
* Use DOMParser to create and fill an inert body element (on Firefox)
|
|
7840
|
-
* See https://github.com/cure53/DOMPurify/releases/tag/0.6.7
|
|
7841
|
-
*
|
|
7842
|
-
*/
|
|
7843
|
-
function (html) {
|
|
6844
|
+
InertBodyHelper.prototype.getInertBodyElement_DOMParser = function (html) {
|
|
7844
6845
|
// We add these extra elements to ensure that the rest of the content is parsed as expected
|
|
7845
6846
|
// e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the
|
|
7846
6847
|
// `<head>` tag.
|
|
@@ -7850,7 +6851,7 @@ var InertBodyHelper = /** @class */ (function () {
|
|
|
7850
6851
|
.DOMParser()
|
|
7851
6852
|
.parseFromString(html, 'text/html')
|
|
7852
6853
|
.body;
|
|
7853
|
-
body.removeChild(
|
|
6854
|
+
body.removeChild(body.firstChild);
|
|
7854
6855
|
return body;
|
|
7855
6856
|
}
|
|
7856
6857
|
catch (e) {
|
|
@@ -7863,19 +6864,7 @@ var InertBodyHelper = /** @class */ (function () {
|
|
|
7863
6864
|
* This is the default sane strategy to use if the browser does not require one of the specialised
|
|
7864
6865
|
* strategies above.
|
|
7865
6866
|
*/
|
|
7866
|
-
|
|
7867
|
-
* Use an HTML5 `template` element, if supported, or an inert body element created via
|
|
7868
|
-
* `createHtmlDocument` to create and fill an inert DOM element.
|
|
7869
|
-
* This is the default sane strategy to use if the browser does not require one of the specialised
|
|
7870
|
-
* strategies above.
|
|
7871
|
-
*/
|
|
7872
|
-
InertBodyHelper.prototype.getInertBodyElement_InertDocument = /**
|
|
7873
|
-
* Use an HTML5 `template` element, if supported, or an inert body element created via
|
|
7874
|
-
* `createHtmlDocument` to create and fill an inert DOM element.
|
|
7875
|
-
* This is the default sane strategy to use if the browser does not require one of the specialised
|
|
7876
|
-
* strategies above.
|
|
7877
|
-
*/
|
|
7878
|
-
function (html) {
|
|
6867
|
+
InertBodyHelper.prototype.getInertBodyElement_InertDocument = function (html) {
|
|
7879
6868
|
// Prefer using <template> element if supported.
|
|
7880
6869
|
var templateEl = this.inertDocument.createElement('template');
|
|
7881
6870
|
if ('content' in templateEl) {
|
|
@@ -7898,23 +6887,7 @@ var InertBodyHelper = /** @class */ (function () {
|
|
|
7898
6887
|
* This is undesirable since we don't want to allow any of these custom attributes. This method
|
|
7899
6888
|
* strips them all.
|
|
7900
6889
|
*/
|
|
7901
|
-
|
|
7902
|
-
* When IE9-11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1'
|
|
7903
|
-
* attribute to declare ns1 namespace and prefixes the attribute with 'ns1' (e.g.
|
|
7904
|
-
* 'ns1:xlink:foo').
|
|
7905
|
-
*
|
|
7906
|
-
* This is undesirable since we don't want to allow any of these custom attributes. This method
|
|
7907
|
-
* strips them all.
|
|
7908
|
-
*/
|
|
7909
|
-
InertBodyHelper.prototype.stripCustomNsAttrs = /**
|
|
7910
|
-
* When IE9-11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1'
|
|
7911
|
-
* attribute to declare ns1 namespace and prefixes the attribute with 'ns1' (e.g.
|
|
7912
|
-
* 'ns1:xlink:foo').
|
|
7913
|
-
*
|
|
7914
|
-
* This is undesirable since we don't want to allow any of these custom attributes. This method
|
|
7915
|
-
* strips them all.
|
|
7916
|
-
*/
|
|
7917
|
-
function (el) {
|
|
6890
|
+
InertBodyHelper.prototype.stripCustomNsAttrs = function (el) {
|
|
7918
6891
|
var elAttrs = el.attributes;
|
|
7919
6892
|
// loop backwards so that we can support removals.
|
|
7920
6893
|
for (var i = elAttrs.length - 1; 0 < i; i--) {
|
|
@@ -8100,20 +7073,20 @@ var SanitizingHtmlSerializer = /** @class */ (function () {
|
|
|
8100
7073
|
// This cannot use a TreeWalker, as it has to run on Angular's various DOM adapters.
|
|
8101
7074
|
// However this code never accesses properties off of `document` before deleting its contents
|
|
8102
7075
|
// again, so it shouldn't be vulnerable to DOM clobbering.
|
|
8103
|
-
var current =
|
|
7076
|
+
var current = el.firstChild;
|
|
8104
7077
|
while (current) {
|
|
8105
7078
|
if (current.nodeType === Node.ELEMENT_NODE) {
|
|
8106
7079
|
this.startElement(current);
|
|
8107
7080
|
}
|
|
8108
7081
|
else if (current.nodeType === Node.TEXT_NODE) {
|
|
8109
|
-
this.chars(
|
|
7082
|
+
this.chars(current.nodeValue);
|
|
8110
7083
|
}
|
|
8111
7084
|
else {
|
|
8112
7085
|
// Strip non-element, non-text nodes.
|
|
8113
7086
|
this.sanitizedSomething = true;
|
|
8114
7087
|
}
|
|
8115
7088
|
if (current.firstChild) {
|
|
8116
|
-
current =
|
|
7089
|
+
current = current.firstChild;
|
|
8117
7090
|
continue;
|
|
8118
7091
|
}
|
|
8119
7092
|
while (current) {
|
|
@@ -8121,12 +7094,12 @@ var SanitizingHtmlSerializer = /** @class */ (function () {
|
|
|
8121
7094
|
if (current.nodeType === Node.ELEMENT_NODE) {
|
|
8122
7095
|
this.endElement(current);
|
|
8123
7096
|
}
|
|
8124
|
-
var next = this.checkClobberedElement(current,
|
|
7097
|
+
var next = this.checkClobberedElement(current, current.nextSibling);
|
|
8125
7098
|
if (next) {
|
|
8126
7099
|
current = next;
|
|
8127
7100
|
break;
|
|
8128
7101
|
}
|
|
8129
|
-
current = this.checkClobberedElement(current,
|
|
7102
|
+
current = this.checkClobberedElement(current, current.parentNode);
|
|
8130
7103
|
}
|
|
8131
7104
|
}
|
|
8132
7105
|
return this.buf.join('');
|
|
@@ -8224,7 +7197,7 @@ function _sanitizeHtml(defaultDoc, unsafeHtmlInput) {
|
|
|
8224
7197
|
inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);
|
|
8225
7198
|
} while (unsafeHtml !== parsedHtml);
|
|
8226
7199
|
var sanitizer = new SanitizingHtmlSerializer();
|
|
8227
|
-
var safeHtml = sanitizer.sanitizeChildren(getTemplateContent(
|
|
7200
|
+
var safeHtml = sanitizer.sanitizeChildren(getTemplateContent(inertBodyElement) || inertBodyElement);
|
|
8228
7201
|
if (isDevMode() && sanitizer.sanitizedSomething) {
|
|
8229
7202
|
console.warn('WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security#xss).');
|
|
8230
7203
|
}
|
|
@@ -8348,22 +7321,6 @@ function _sanitizeStyle(value) {
|
|
|
8348
7321
|
* Use of this source code is governed by an MIT-style license that can be
|
|
8349
7322
|
* found in the LICENSE file at https://angular.io/license
|
|
8350
7323
|
*/
|
|
8351
|
-
/**
|
|
8352
|
-
* @license
|
|
8353
|
-
* Copyright Google Inc. All Rights Reserved.
|
|
8354
|
-
*
|
|
8355
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
8356
|
-
* found in the LICENSE file at https://angular.io/license
|
|
8357
|
-
*/
|
|
8358
|
-
/**
|
|
8359
|
-
* A SecurityContext marks a location that has dangerous security implications, e.g. a DOM property
|
|
8360
|
-
* like `innerHTML` that could cause Cross Site Scripting (XSS) security bugs when improperly
|
|
8361
|
-
* handled.
|
|
8362
|
-
*
|
|
8363
|
-
* See DomSanitizer for more details on security in Angular applications.
|
|
8364
|
-
*
|
|
8365
|
-
*
|
|
8366
|
-
*/
|
|
8367
7324
|
/**
|
|
8368
7325
|
* A SecurityContext marks a location that has dangerous security implications, e.g. a DOM property
|
|
8369
7326
|
* like `innerHTML` that could cause Cross Site Scripting (XSS) security bugs when improperly
|
|
@@ -8374,15 +7331,6 @@ function _sanitizeStyle(value) {
|
|
|
8374
7331
|
*
|
|
8375
7332
|
*/
|
|
8376
7333
|
|
|
8377
|
-
/**
|
|
8378
|
-
* A SecurityContext marks a location that has dangerous security implications, e.g. a DOM property
|
|
8379
|
-
* like `innerHTML` that could cause Cross Site Scripting (XSS) security bugs when improperly
|
|
8380
|
-
* handled.
|
|
8381
|
-
*
|
|
8382
|
-
* See DomSanitizer for more details on security in Angular applications.
|
|
8383
|
-
*
|
|
8384
|
-
*
|
|
8385
|
-
*/
|
|
8386
7334
|
(function (SecurityContext) {
|
|
8387
7335
|
SecurityContext[SecurityContext["NONE"] = 0] = "NONE";
|
|
8388
7336
|
SecurityContext[SecurityContext["HTML"] = 1] = "HTML";
|
|
@@ -8481,23 +7429,23 @@ var DebugContext = /** @class */ (function () {
|
|
|
8481
7429
|
* debug mode can hook it. It is lazily filled when `isDevMode` is known.
|
|
8482
7430
|
*/
|
|
8483
7431
|
var Services = {
|
|
8484
|
-
setCurrentNode:
|
|
8485
|
-
createRootView:
|
|
8486
|
-
createEmbeddedView:
|
|
8487
|
-
createComponentView:
|
|
8488
|
-
createNgModuleRef:
|
|
8489
|
-
overrideProvider:
|
|
8490
|
-
overrideComponentView:
|
|
8491
|
-
clearOverrides:
|
|
8492
|
-
checkAndUpdateView:
|
|
8493
|
-
checkNoChangesView:
|
|
8494
|
-
destroyView:
|
|
8495
|
-
resolveDep:
|
|
8496
|
-
createDebugContext:
|
|
8497
|
-
handleEvent:
|
|
8498
|
-
updateDirectives:
|
|
8499
|
-
updateRenderer:
|
|
8500
|
-
dirtyParentQueries:
|
|
7432
|
+
setCurrentNode: undefined,
|
|
7433
|
+
createRootView: undefined,
|
|
7434
|
+
createEmbeddedView: undefined,
|
|
7435
|
+
createComponentView: undefined,
|
|
7436
|
+
createNgModuleRef: undefined,
|
|
7437
|
+
overrideProvider: undefined,
|
|
7438
|
+
overrideComponentView: undefined,
|
|
7439
|
+
clearOverrides: undefined,
|
|
7440
|
+
checkAndUpdateView: undefined,
|
|
7441
|
+
checkNoChangesView: undefined,
|
|
7442
|
+
destroyView: undefined,
|
|
7443
|
+
resolveDep: undefined,
|
|
7444
|
+
createDebugContext: undefined,
|
|
7445
|
+
handleEvent: undefined,
|
|
7446
|
+
updateDirectives: undefined,
|
|
7447
|
+
updateRenderer: undefined,
|
|
7448
|
+
dirtyParentQueries: undefined,
|
|
8501
7449
|
};
|
|
8502
7450
|
|
|
8503
7451
|
/**
|
|
@@ -8761,7 +7709,7 @@ function rootRenderNodes(view) {
|
|
|
8761
7709
|
function visitRootRenderNodes(view, action, parentNode, nextSibling, target) {
|
|
8762
7710
|
// We need to re-compute the parent node in case the nodes have been moved around manually
|
|
8763
7711
|
if (action === 3 /* RemoveChild */) {
|
|
8764
|
-
parentNode = view.renderer.parentNode(renderNode(view,
|
|
7712
|
+
parentNode = view.renderer.parentNode(renderNode(view, view.def.lastRenderRootNode));
|
|
8765
7713
|
}
|
|
8766
7714
|
visitSiblingRenderNodes(view, action, 0, view.def.nodes.length - 1, parentNode, nextSibling, target);
|
|
8767
7715
|
}
|
|
@@ -8781,13 +7729,13 @@ function visitProjectedRenderNodes(view, ngContentIndex, action, parentNode, nex
|
|
|
8781
7729
|
compView = compView.parent;
|
|
8782
7730
|
}
|
|
8783
7731
|
var hostView = compView.parent;
|
|
8784
|
-
var hostElDef = viewParentEl(
|
|
7732
|
+
var hostElDef = viewParentEl(compView);
|
|
8785
7733
|
var startIndex = hostElDef.nodeIndex + 1;
|
|
8786
7734
|
var endIndex = hostElDef.nodeIndex + hostElDef.childCount;
|
|
8787
7735
|
for (var i = startIndex; i <= endIndex; i++) {
|
|
8788
7736
|
var nodeDef = hostView.def.nodes[i];
|
|
8789
7737
|
if (nodeDef.ngContentIndex === ngContentIndex) {
|
|
8790
|
-
visitRenderNode(
|
|
7738
|
+
visitRenderNode(hostView, nodeDef, action, parentNode, nextSibling, target);
|
|
8791
7739
|
}
|
|
8792
7740
|
// jump to next sibling
|
|
8793
7741
|
i += nodeDef.childCount;
|
|
@@ -8853,7 +7801,7 @@ function execRenderNodeAction(view, renderNode, action, parentNode, nextSibling,
|
|
|
8853
7801
|
var NS_PREFIX_RE = /^:([^:]+):(.+)$/;
|
|
8854
7802
|
function splitNamespace(name) {
|
|
8855
7803
|
if (name[0] === ':') {
|
|
8856
|
-
var match =
|
|
7804
|
+
var match = name.match(NS_PREFIX_RE);
|
|
8857
7805
|
return [match[1], match[2]];
|
|
8858
7806
|
}
|
|
8859
7807
|
return ['', name];
|
|
@@ -8962,8 +7910,8 @@ function elementDef(checkIndex, flags, matchedQueriesDsl, ngContentIndex, childC
|
|
|
8962
7910
|
handleEvent = NOOP;
|
|
8963
7911
|
}
|
|
8964
7912
|
var _a = splitMatchedQueriesDsl(matchedQueriesDsl), matchedQueries = _a.matchedQueries, references = _a.references, matchedQueryIds = _a.matchedQueryIds;
|
|
8965
|
-
var ns =
|
|
8966
|
-
var name =
|
|
7913
|
+
var ns = null;
|
|
7914
|
+
var name = null;
|
|
8967
7915
|
if (namespaceAndName) {
|
|
8968
7916
|
_b = __read(splitNamespace(namespaceAndName), 2), ns = _b[0], name = _b[1];
|
|
8969
7917
|
}
|
|
@@ -8972,8 +7920,8 @@ function elementDef(checkIndex, flags, matchedQueriesDsl, ngContentIndex, childC
|
|
|
8972
7920
|
for (var i = 0; i < bindings.length; i++) {
|
|
8973
7921
|
var _c = __read(bindings[i], 3), bindingFlags = _c[0], namespaceAndName_1 = _c[1], suffixOrSecurityContext = _c[2];
|
|
8974
7922
|
var _d = __read(splitNamespace(namespaceAndName_1), 2), ns_1 = _d[0], name_1 = _d[1];
|
|
8975
|
-
var securityContext =
|
|
8976
|
-
var suffix =
|
|
7923
|
+
var securityContext = undefined;
|
|
7924
|
+
var suffix = undefined;
|
|
8977
7925
|
switch (bindingFlags & 15 /* Types */) {
|
|
8978
7926
|
case 4 /* TypeElementStyle */:
|
|
8979
7927
|
suffix = suffixOrSecurityContext;
|
|
@@ -9044,7 +7992,7 @@ function elementDef(checkIndex, flags, matchedQueriesDsl, ngContentIndex, childC
|
|
|
9044
7992
|
var _b;
|
|
9045
7993
|
}
|
|
9046
7994
|
function createElement(view, renderHost, def) {
|
|
9047
|
-
var elDef =
|
|
7995
|
+
var elDef = def.element;
|
|
9048
7996
|
var rootSelectorOrNode = view.root.selectorOrNode;
|
|
9049
7997
|
var renderer = view.renderer;
|
|
9050
7998
|
var el;
|
|
@@ -9128,7 +8076,7 @@ function checkAndUpdateElementValue(view, def, bindingIdx, value) {
|
|
|
9128
8076
|
var binding = def.bindings[bindingIdx];
|
|
9129
8077
|
var elData = asElementData(view, def.nodeIndex);
|
|
9130
8078
|
var renderNode$$1 = elData.renderElement;
|
|
9131
|
-
var name =
|
|
8079
|
+
var name = binding.name;
|
|
9132
8080
|
switch (binding.flags & 15 /* Types */) {
|
|
9133
8081
|
case 1 /* TypeElementAttribute */:
|
|
9134
8082
|
setElementAttribute(view, binding, renderNode$$1, binding.ns, name, value);
|
|
@@ -9298,6 +8246,9 @@ function resolveNgModuleDep(data, depDef, notFoundValue) {
|
|
|
9298
8246
|
return (data._providers[index] =
|
|
9299
8247
|
_createProviderInstance$1(data, data._def.providersByKey[depDef.tokenKey]));
|
|
9300
8248
|
}
|
|
8249
|
+
else if (depDef.flags & 4 /* Self */) {
|
|
8250
|
+
return notFoundValue;
|
|
8251
|
+
}
|
|
9301
8252
|
return data._parent.get(depDef.token, notFoundValue);
|
|
9302
8253
|
}
|
|
9303
8254
|
finally {
|
|
@@ -9406,10 +8357,10 @@ function attachEmbeddedView(parentView, elementData, viewIndex, view) {
|
|
|
9406
8357
|
viewIndex = embeddedViews.length;
|
|
9407
8358
|
}
|
|
9408
8359
|
view.viewContainerParent = parentView;
|
|
9409
|
-
addToArray(embeddedViews,
|
|
8360
|
+
addToArray(embeddedViews, viewIndex, view);
|
|
9410
8361
|
attachProjectedView(elementData, view);
|
|
9411
8362
|
Services.dirtyParentQueries(view);
|
|
9412
|
-
var prevView =
|
|
8363
|
+
var prevView = viewIndex > 0 ? embeddedViews[viewIndex - 1] : null;
|
|
9413
8364
|
renderAttachEmbeddedView(elementData, prevView, view);
|
|
9414
8365
|
}
|
|
9415
8366
|
function attachProjectedView(vcElementData, view) {
|
|
@@ -9433,7 +8384,7 @@ function attachProjectedView(vcElementData, view) {
|
|
|
9433
8384
|
projectedViews.push(view);
|
|
9434
8385
|
// Note: we are changing the NodeDef here as we cannot calculate
|
|
9435
8386
|
// the fact whether a template is used for projection during compilation.
|
|
9436
|
-
markNodeAsProjectedTemplate(view.parent.def,
|
|
8387
|
+
markNodeAsProjectedTemplate(view.parent.def, view.parentNodeDef);
|
|
9437
8388
|
}
|
|
9438
8389
|
function markNodeAsProjectedTemplate(viewDef, nodeDef) {
|
|
9439
8390
|
if (nodeDef.flags & 4 /* ProjectedTemplate */) {
|
|
@@ -9493,7 +8444,7 @@ function moveEmbeddedView(elementData, oldViewIndex, newViewIndex) {
|
|
|
9493
8444
|
return view;
|
|
9494
8445
|
}
|
|
9495
8446
|
function renderAttachEmbeddedView(elementData, prevView, view) {
|
|
9496
|
-
var prevRenderNode = prevView ? renderNode(prevView,
|
|
8447
|
+
var prevRenderNode = prevView ? renderNode(prevView, prevView.def.lastRenderRootNode) :
|
|
9497
8448
|
elementData.renderElement;
|
|
9498
8449
|
var parentNode = view.renderer.parentNode(prevRenderNode);
|
|
9499
8450
|
var nextSibling = view.renderer.nextSibling(prevRenderNode);
|
|
@@ -9557,7 +8508,7 @@ var ComponentFactory_ = /** @class */ (function (_super) {
|
|
|
9557
8508
|
Object.defineProperty(ComponentFactory_.prototype, "inputs", {
|
|
9558
8509
|
get: function () {
|
|
9559
8510
|
var inputsArr = [];
|
|
9560
|
-
var inputs =
|
|
8511
|
+
var inputs = this._inputs;
|
|
9561
8512
|
for (var propName in inputs) {
|
|
9562
8513
|
var templateName = inputs[propName];
|
|
9563
8514
|
inputsArr.push({ propName: propName, templateName: templateName });
|
|
@@ -9582,13 +8533,7 @@ var ComponentFactory_ = /** @class */ (function (_super) {
|
|
|
9582
8533
|
/**
|
|
9583
8534
|
* Creates a new component.
|
|
9584
8535
|
*/
|
|
9585
|
-
|
|
9586
|
-
* Creates a new component.
|
|
9587
|
-
*/
|
|
9588
|
-
ComponentFactory_.prototype.create = /**
|
|
9589
|
-
* Creates a new component.
|
|
9590
|
-
*/
|
|
9591
|
-
function (injector, projectableNodes, rootSelectorOrNode, ngModule) {
|
|
8536
|
+
ComponentFactory_.prototype.create = function (injector, projectableNodes, rootSelectorOrNode, ngModule) {
|
|
9592
8537
|
if (!ngModule) {
|
|
9593
8538
|
throw new Error('ngModule should be provided');
|
|
9594
8539
|
}
|
|
@@ -9646,8 +8591,8 @@ var ViewContainerRef_ = /** @class */ (function () {
|
|
|
9646
8591
|
this._elDef = _elDef;
|
|
9647
8592
|
this._data = _data;
|
|
9648
8593
|
/**
|
|
9649
|
-
|
|
9650
|
-
|
|
8594
|
+
* @internal
|
|
8595
|
+
*/
|
|
9651
8596
|
this._embeddedViews = [];
|
|
9652
8597
|
}
|
|
9653
8598
|
Object.defineProperty(ViewContainerRef_.prototype, "element", {
|
|
@@ -9666,7 +8611,7 @@ var ViewContainerRef_ = /** @class */ (function () {
|
|
|
9666
8611
|
var elDef = this._elDef.parent;
|
|
9667
8612
|
while (!elDef && view) {
|
|
9668
8613
|
elDef = viewParentEl(view);
|
|
9669
|
-
view =
|
|
8614
|
+
view = view.parent;
|
|
9670
8615
|
}
|
|
9671
8616
|
return view ? new Injector_(view, elDef) : new Injector_(this._view, null);
|
|
9672
8617
|
},
|
|
@@ -9676,7 +8621,7 @@ var ViewContainerRef_ = /** @class */ (function () {
|
|
|
9676
8621
|
ViewContainerRef_.prototype.clear = function () {
|
|
9677
8622
|
var len = this._embeddedViews.length;
|
|
9678
8623
|
for (var i = len - 1; i >= 0; i--) {
|
|
9679
|
-
var view =
|
|
8624
|
+
var view = detachEmbeddedView(this._data, i);
|
|
9680
8625
|
Services.destroyView(view);
|
|
9681
8626
|
}
|
|
9682
8627
|
};
|
|
@@ -9829,7 +8774,7 @@ var TemplateRef_ = /** @class */ (function (_super) {
|
|
|
9829
8774
|
return _this;
|
|
9830
8775
|
}
|
|
9831
8776
|
TemplateRef_.prototype.createEmbeddedView = function (context) {
|
|
9832
|
-
return new ViewRef_(Services.createEmbeddedView(this._parentView, this._def,
|
|
8777
|
+
return new ViewRef_(Services.createEmbeddedView(this._parentView, this._def, this._def.element.template, context));
|
|
9833
8778
|
};
|
|
9834
8779
|
Object.defineProperty(TemplateRef_.prototype, "elementRef", {
|
|
9835
8780
|
get: function () {
|
|
@@ -10108,13 +9053,13 @@ function createPipeInstance(view, def) {
|
|
|
10108
9053
|
// pipes can see the private services of the component
|
|
10109
9054
|
var allowPrivateServices = true;
|
|
10110
9055
|
// pipes are always eager and classes!
|
|
10111
|
-
return createClass(
|
|
9056
|
+
return createClass(compView.parent, viewParentEl(compView), allowPrivateServices, def.provider.value, def.provider.deps);
|
|
10112
9057
|
}
|
|
10113
9058
|
function createDirectiveInstance(view, def) {
|
|
10114
9059
|
// components can see other private services, other directives can't.
|
|
10115
9060
|
var allowPrivateServices = (def.flags & 32768 /* Component */) > 0;
|
|
10116
9061
|
// directives are always eager and classes!
|
|
10117
|
-
var instance = createClass(view,
|
|
9062
|
+
var instance = createClass(view, def.parent, allowPrivateServices, def.provider.value, def.provider.deps);
|
|
10118
9063
|
if (def.outputs.length) {
|
|
10119
9064
|
for (var i = 0; i < def.outputs.length; i++) {
|
|
10120
9065
|
var output = def.outputs[i];
|
|
@@ -10131,7 +9076,7 @@ function checkAndUpdateDirectiveInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7
|
|
|
10131
9076
|
var providerData = asProviderData(view, def.nodeIndex);
|
|
10132
9077
|
var directive = providerData.instance;
|
|
10133
9078
|
var changed = false;
|
|
10134
|
-
var changes =
|
|
9079
|
+
var changes = undefined;
|
|
10135
9080
|
var bindLen = def.bindings.length;
|
|
10136
9081
|
if (bindLen > 0 && checkBinding(view, def, 0, v0)) {
|
|
10137
9082
|
changed = true;
|
|
@@ -10189,7 +9134,7 @@ function checkAndUpdateDirectiveDynamic(view, def, values) {
|
|
|
10189
9134
|
var providerData = asProviderData(view, def.nodeIndex);
|
|
10190
9135
|
var directive = providerData.instance;
|
|
10191
9136
|
var changed = false;
|
|
10192
|
-
var changes =
|
|
9137
|
+
var changes = undefined;
|
|
10193
9138
|
for (var i = 0; i < values.length; i++) {
|
|
10194
9139
|
if (checkBinding(view, def, i, values[i])) {
|
|
10195
9140
|
changed = true;
|
|
@@ -10214,11 +9159,11 @@ function _createProviderInstance(view, def) {
|
|
|
10214
9159
|
var providerDef = def.provider;
|
|
10215
9160
|
switch (def.flags & 201347067 /* Types */) {
|
|
10216
9161
|
case 512 /* TypeClassProvider */:
|
|
10217
|
-
return createClass(view,
|
|
9162
|
+
return createClass(view, def.parent, allowPrivateServices, providerDef.value, providerDef.deps);
|
|
10218
9163
|
case 1024 /* TypeFactoryProvider */:
|
|
10219
|
-
return callFactory(view,
|
|
9164
|
+
return callFactory(view, def.parent, allowPrivateServices, providerDef.value, providerDef.deps);
|
|
10220
9165
|
case 2048 /* TypeUseExistingProvider */:
|
|
10221
|
-
return resolveDep(view,
|
|
9166
|
+
return resolveDep(view, def.parent, allowPrivateServices, providerDef.deps[0]);
|
|
10222
9167
|
case 256 /* TypeValueProvider */:
|
|
10223
9168
|
return providerDef.value;
|
|
10224
9169
|
}
|
|
@@ -10296,7 +9241,7 @@ function resolveDep(view, elDef, allowPrivateServices, depDef, notFoundValue) {
|
|
|
10296
9241
|
}
|
|
10297
9242
|
if (elDef && (depDef.flags & 1 /* SkipSelf */)) {
|
|
10298
9243
|
allowPrivateServices = false;
|
|
10299
|
-
elDef =
|
|
9244
|
+
elDef = elDef.parent;
|
|
10300
9245
|
}
|
|
10301
9246
|
var searchView = view;
|
|
10302
9247
|
while (searchView) {
|
|
@@ -10341,8 +9286,8 @@ function resolveDep(view, elDef, allowPrivateServices, depDef, notFoundValue) {
|
|
|
10341
9286
|
}
|
|
10342
9287
|
}
|
|
10343
9288
|
allowPrivateServices = isComponentView(searchView);
|
|
10344
|
-
elDef =
|
|
10345
|
-
searchView =
|
|
9289
|
+
elDef = viewParentEl(searchView);
|
|
9290
|
+
searchView = searchView.parent;
|
|
10346
9291
|
if (depDef.flags & 4 /* Self */) {
|
|
10347
9292
|
searchView = null;
|
|
10348
9293
|
}
|
|
@@ -10380,7 +9325,7 @@ function updateProp(view, providerData, def, bindingIdx, value, changes) {
|
|
|
10380
9325
|
}
|
|
10381
9326
|
}
|
|
10382
9327
|
var binding = def.bindings[bindingIdx];
|
|
10383
|
-
var propName =
|
|
9328
|
+
var propName = binding.name;
|
|
10384
9329
|
// Note: This is still safe with Closure Compiler as
|
|
10385
9330
|
// the user passed in the property name as an object has to `providerDef`,
|
|
10386
9331
|
// so Closure Compiler will have renamed the property correctly already.
|
|
@@ -10552,7 +9497,7 @@ function createQuery() {
|
|
|
10552
9497
|
function dirtyParentQueries(view) {
|
|
10553
9498
|
var queryIds = view.def.nodeMatchedQueries;
|
|
10554
9499
|
while (view.parent && isEmbeddedView(view)) {
|
|
10555
|
-
var tplDef =
|
|
9500
|
+
var tplDef = view.parentNodeDef;
|
|
10556
9501
|
view = view.parent;
|
|
10557
9502
|
// content queries
|
|
10558
9503
|
var end = tplDef.nodeIndex + tplDef.childCount;
|
|
@@ -10589,14 +9534,14 @@ function checkAndUpdateQuery(view, nodeDef) {
|
|
|
10589
9534
|
return;
|
|
10590
9535
|
}
|
|
10591
9536
|
var directiveInstance;
|
|
10592
|
-
var newValues =
|
|
9537
|
+
var newValues = undefined;
|
|
10593
9538
|
if (nodeDef.flags & 67108864 /* TypeContentQuery */) {
|
|
10594
|
-
var elementDef =
|
|
10595
|
-
newValues = calcQueryValues(view, elementDef.nodeIndex, elementDef.nodeIndex + elementDef.childCount,
|
|
9539
|
+
var elementDef = nodeDef.parent.parent;
|
|
9540
|
+
newValues = calcQueryValues(view, elementDef.nodeIndex, elementDef.nodeIndex + elementDef.childCount, nodeDef.query, []);
|
|
10596
9541
|
directiveInstance = asProviderData(view, nodeDef.parent.nodeIndex).instance;
|
|
10597
9542
|
}
|
|
10598
9543
|
else if (nodeDef.flags & 134217728 /* TypeViewQuery */) {
|
|
10599
|
-
newValues = calcQueryValues(view, 0, view.def.nodes.length - 1,
|
|
9544
|
+
newValues = calcQueryValues(view, 0, view.def.nodes.length - 1, nodeDef.query, []);
|
|
10600
9545
|
directiveInstance = view.component;
|
|
10601
9546
|
}
|
|
10602
9547
|
queryList.reset(newValues);
|
|
@@ -11123,7 +10068,6 @@ function viewDef(flags, nodes, updateDirectives, updateRenderer) {
|
|
|
11123
10068
|
if (!currentElementHasPublicProviders) {
|
|
11124
10069
|
currentElementHasPublicProviders = true;
|
|
11125
10070
|
// Use prototypical inheritance to not get O(n^2) complexity...
|
|
11126
|
-
// Use prototypical inheritance to not get O(n^2) complexity...
|
|
11127
10071
|
currentParent.element.publicProviders =
|
|
11128
10072
|
Object.create(currentParent.element.publicProviders);
|
|
11129
10073
|
currentParent.element.allProviders = currentParent.element.publicProviders;
|
|
@@ -11137,7 +10081,6 @@ function viewDef(flags, nodes, updateDirectives, updateRenderer) {
|
|
|
11137
10081
|
if (!currentElementHasPrivateProviders) {
|
|
11138
10082
|
currentElementHasPrivateProviders = true;
|
|
11139
10083
|
// Use prototypical inheritance to not get O(n^2) complexity...
|
|
11140
|
-
// Use prototypical inheritance to not get O(n^2) complexity...
|
|
11141
10084
|
currentParent.element.allProviders =
|
|
11142
10085
|
Object.create(currentParent.element.publicProviders);
|
|
11143
10086
|
}
|
|
@@ -11287,7 +10230,7 @@ function createViewNodes(view) {
|
|
|
11287
10230
|
var renderHost;
|
|
11288
10231
|
if (isComponentView(view)) {
|
|
11289
10232
|
var hostDef = view.parentNodeDef;
|
|
11290
|
-
renderHost = asElementData(
|
|
10233
|
+
renderHost = asElementData(view.parent, hostDef.parent.nodeIndex).renderElement;
|
|
11291
10234
|
}
|
|
11292
10235
|
var def = view.def;
|
|
11293
10236
|
var nodes = view.nodes;
|
|
@@ -11298,9 +10241,9 @@ function createViewNodes(view) {
|
|
|
11298
10241
|
switch (nodeDef.flags & 201347067 /* Types */) {
|
|
11299
10242
|
case 1 /* TypeElement */:
|
|
11300
10243
|
var el = createElement(view, renderHost, nodeDef);
|
|
11301
|
-
var componentView =
|
|
10244
|
+
var componentView = undefined;
|
|
11302
10245
|
if (nodeDef.flags & 33554432 /* ComponentView */) {
|
|
11303
|
-
var compViewDef = resolveDefinition(
|
|
10246
|
+
var compViewDef = resolveDefinition(nodeDef.element.componentView);
|
|
11304
10247
|
componentView = Services.createComponentView(view, nodeDef, compViewDef, el);
|
|
11305
10248
|
}
|
|
11306
10249
|
listenToElementOutputs(view, componentView, nodeDef, el);
|
|
@@ -11735,14 +10678,10 @@ function createProdServices() {
|
|
|
11735
10678
|
handleEvent: function (view, nodeIndex, eventName, event) {
|
|
11736
10679
|
return view.def.handleEvent(view, nodeIndex, eventName, event);
|
|
11737
10680
|
},
|
|
11738
|
-
updateDirectives: function (view, checkType) {
|
|
11739
|
-
|
|
11740
|
-
|
|
11741
|
-
|
|
11742
|
-
updateRenderer: function (view, checkType) {
|
|
11743
|
-
return view.def.updateRenderer(checkType === 0 /* CheckAndUpdate */ ? prodCheckAndUpdateNode :
|
|
11744
|
-
prodCheckNoChangesNode, view);
|
|
11745
|
-
},
|
|
10681
|
+
updateDirectives: function (view, checkType) { return view.def.updateDirectives(checkType === 0 /* CheckAndUpdate */ ? prodCheckAndUpdateNode :
|
|
10682
|
+
prodCheckNoChangesNode, view); },
|
|
10683
|
+
updateRenderer: function (view, checkType) { return view.def.updateRenderer(checkType === 0 /* CheckAndUpdate */ ? prodCheckAndUpdateNode :
|
|
10684
|
+
prodCheckNoChangesNode, view); },
|
|
11746
10685
|
};
|
|
11747
10686
|
}
|
|
11748
10687
|
function createDebugServices() {
|
|
@@ -11814,7 +10753,7 @@ function debugOverrideProvider(override) {
|
|
|
11814
10753
|
}
|
|
11815
10754
|
function debugOverrideComponentView(comp, compFactory) {
|
|
11816
10755
|
var hostViewDef = resolveDefinition(getComponentViewDefinitionFactory(compFactory));
|
|
11817
|
-
var compViewDef = resolveDefinition(
|
|
10756
|
+
var compViewDef = resolveDefinition(hostViewDef.nodes[0].element.componentView);
|
|
11818
10757
|
viewDefOverrides.set(comp, compViewDef);
|
|
11819
10758
|
}
|
|
11820
10759
|
function debugClearOverrides() {
|
|
@@ -11867,7 +10806,7 @@ function applyProviderOverridesToView(def) {
|
|
|
11867
10806
|
return;
|
|
11868
10807
|
}
|
|
11869
10808
|
if (nodeDef.flags & 3840 /* CatProviderNoDirective */) {
|
|
11870
|
-
var provider =
|
|
10809
|
+
var provider = nodeDef.provider;
|
|
11871
10810
|
var override = providerOverrides.get(provider.token);
|
|
11872
10811
|
if (override) {
|
|
11873
10812
|
nodeDef.flags = (nodeDef.flags & ~3840 /* CatProviderNoDirective */) | override.flags;
|
|
@@ -12052,11 +10991,11 @@ function debugCheckAndUpdateNode(view, nodeDef, argStyle, givenValues) {
|
|
|
12052
10991
|
var binding = nodeDef.bindings[i];
|
|
12053
10992
|
var value = values[i];
|
|
12054
10993
|
if (binding.flags & 8 /* TypeProperty */) {
|
|
12055
|
-
bindingValues[normalizeDebugBindingName(
|
|
10994
|
+
bindingValues[normalizeDebugBindingName(binding.nonMinifiedName)] =
|
|
12056
10995
|
normalizeDebugBindingValue(value);
|
|
12057
10996
|
}
|
|
12058
10997
|
}
|
|
12059
|
-
var elDef =
|
|
10998
|
+
var elDef = nodeDef.parent;
|
|
12060
10999
|
var el = asElementData(view, elDef.nodeIndex).renderElement;
|
|
12061
11000
|
if (!elDef.element.name) {
|
|
12062
11001
|
// a comment.
|
|
@@ -12133,12 +11072,12 @@ var DebugContext_ = /** @class */ (function () {
|
|
|
12133
11072
|
var elDef = this.nodeDef;
|
|
12134
11073
|
var elView = view;
|
|
12135
11074
|
while (elDef && (elDef.flags & 1 /* TypeElement */) === 0) {
|
|
12136
|
-
elDef =
|
|
11075
|
+
elDef = elDef.parent;
|
|
12137
11076
|
}
|
|
12138
11077
|
if (!elDef) {
|
|
12139
11078
|
while (!elDef && elView) {
|
|
12140
|
-
elDef =
|
|
12141
|
-
elView =
|
|
11079
|
+
elDef = viewParentEl(elView);
|
|
11080
|
+
elView = elView.parent;
|
|
12142
11081
|
}
|
|
12143
11082
|
}
|
|
12144
11083
|
this.elDef = elDef;
|
|
@@ -12267,7 +11206,7 @@ function getRenderNodeIndex(viewDef$$1, nodeIndex) {
|
|
|
12267
11206
|
}
|
|
12268
11207
|
function findHostElement(view) {
|
|
12269
11208
|
while (view && !isComponentView(view)) {
|
|
12270
|
-
view =
|
|
11209
|
+
view = view.parent;
|
|
12271
11210
|
}
|
|
12272
11211
|
if (view.parent) {
|
|
12273
11212
|
return asElementData(view.parent, viewParentEl(view).nodeIndex);
|
|
@@ -12295,7 +11234,7 @@ function callWithDebugContext(action, fn, self, args) {
|
|
|
12295
11234
|
if (isViewDebugError(e) || !_currentView) {
|
|
12296
11235
|
throw e;
|
|
12297
11236
|
}
|
|
12298
|
-
throw viewWrappedDebugError(e,
|
|
11237
|
+
throw viewWrappedDebugError(e, getCurrentDebugContext());
|
|
12299
11238
|
}
|
|
12300
11239
|
}
|
|
12301
11240
|
function getCurrentDebugContext() {
|
|
@@ -12332,7 +11271,7 @@ var DebugRenderer2 = /** @class */ (function () {
|
|
|
12332
11271
|
this.data = this.delegate.data;
|
|
12333
11272
|
}
|
|
12334
11273
|
DebugRenderer2.prototype.destroyNode = function (node) {
|
|
12335
|
-
removeDebugNodeFromIndex(
|
|
11274
|
+
removeDebugNodeFromIndex(getDebugNode(node));
|
|
12336
11275
|
if (this.delegate.destroyNode) {
|
|
12337
11276
|
this.delegate.destroyNode(node);
|
|
12338
11277
|
}
|
|
@@ -12375,7 +11314,7 @@ var DebugRenderer2 = /** @class */ (function () {
|
|
|
12375
11314
|
DebugRenderer2.prototype.insertBefore = function (parent, newChild, refChild) {
|
|
12376
11315
|
var debugEl = getDebugNode(parent);
|
|
12377
11316
|
var debugChildEl = getDebugNode(newChild);
|
|
12378
|
-
var debugRefEl =
|
|
11317
|
+
var debugRefEl = getDebugNode(refChild);
|
|
12379
11318
|
if (debugEl && debugChildEl && debugEl instanceof DebugElement) {
|
|
12380
11319
|
debugEl.insertBefore(debugRefEl, debugChildEl);
|
|
12381
11320
|
}
|
|
@@ -12664,7 +11603,7 @@ function queueDestroyHooks(def, tView, i) {
|
|
|
12664
11603
|
*/
|
|
12665
11604
|
function executeInitHooks(currentView, tView, creationMode) {
|
|
12666
11605
|
if (currentView.lifecycleStage === 1 /* Init */) {
|
|
12667
|
-
executeHooks(
|
|
11606
|
+
executeHooks(currentView.directives, tView.initHooks, tView.checkHooks, creationMode);
|
|
12668
11607
|
currentView.lifecycleStage = 2 /* AfterInit */;
|
|
12669
11608
|
}
|
|
12670
11609
|
}
|
|
@@ -12779,9 +11718,7 @@ function typeName(type) {
|
|
|
12779
11718
|
* found in the LICENSE file at https://angular.io/license
|
|
12780
11719
|
*/
|
|
12781
11720
|
// TODO: cleanup once the code is merged in angular/angular
|
|
12782
|
-
// TODO: cleanup once the code is merged in angular/angular
|
|
12783
11721
|
var RendererStyleFlags3;
|
|
12784
|
-
// TODO: cleanup once the code is merged in angular/angular
|
|
12785
11722
|
(function (RendererStyleFlags3) {
|
|
12786
11723
|
RendererStyleFlags3[RendererStyleFlags3["Important"] = 1] = "Important";
|
|
12787
11724
|
RendererStyleFlags3[RendererStyleFlags3["DashCase"] = 2] = "DashCase";
|
|
@@ -12893,7 +11830,7 @@ function findNextRNodeSibling(node, stopNode) {
|
|
|
12893
11830
|
if (nativeNode) {
|
|
12894
11831
|
return nativeNode;
|
|
12895
11832
|
}
|
|
12896
|
-
pNextOrParent =
|
|
11833
|
+
pNextOrParent = pNextOrParent.pNextOrParent;
|
|
12897
11834
|
}
|
|
12898
11835
|
currentNode = pNextOrParent;
|
|
12899
11836
|
}
|
|
@@ -13011,21 +11948,18 @@ function addRemoveViewFromContainer(container, rootNode, insertMode, beforeNode)
|
|
|
13011
11948
|
if (node.type === 3 /* Element */) {
|
|
13012
11949
|
if (insertMode) {
|
|
13013
11950
|
if (!node.native) {
|
|
13014
|
-
// If the native element doesn't exist, this is a bound text node that hasn't yet been
|
|
13015
|
-
// created because update mode has not run (occurs when a bound text node is a root
|
|
13016
|
-
// node of a dynamically created view). See textBinding() in instructions for ctx.
|
|
13017
11951
|
// If the native element doesn't exist, this is a bound text node that hasn't yet been
|
|
13018
11952
|
// created because update mode has not run (occurs when a bound text node is a root
|
|
13019
11953
|
// node of a dynamically created view). See textBinding() in instructions for ctx.
|
|
13020
11954
|
node.native = createTextNode('', renderer);
|
|
13021
11955
|
}
|
|
13022
11956
|
isProceduralRenderer(renderer) ?
|
|
13023
|
-
renderer.insertBefore(parent,
|
|
13024
|
-
parent.insertBefore(
|
|
11957
|
+
renderer.insertBefore(parent, node.native, beforeNode) :
|
|
11958
|
+
parent.insertBefore(node.native, beforeNode, true);
|
|
13025
11959
|
}
|
|
13026
11960
|
else {
|
|
13027
|
-
isProceduralRenderer(renderer) ? renderer.removeChild(parent,
|
|
13028
|
-
parent.removeChild(
|
|
11961
|
+
isProceduralRenderer(renderer) ? renderer.removeChild(parent, node.native) :
|
|
11962
|
+
parent.removeChild(node.native);
|
|
13029
11963
|
}
|
|
13030
11964
|
nextNode = node.next;
|
|
13031
11965
|
}
|
|
@@ -13207,7 +12141,7 @@ function cleanUpView(view) {
|
|
|
13207
12141
|
}
|
|
13208
12142
|
/** Removes listeners and unsubscribes from output subscriptions */
|
|
13209
12143
|
function removeListeners(view) {
|
|
13210
|
-
var cleanup =
|
|
12144
|
+
var cleanup = view.cleanup;
|
|
13211
12145
|
if (cleanup != null) {
|
|
13212
12146
|
for (var i = 0; i < cleanup.length - 1; i += 2) {
|
|
13213
12147
|
if (typeof cleanup[i] === 'string') {
|
|
@@ -13226,14 +12160,14 @@ function executeOnDestroys(view) {
|
|
|
13226
12160
|
var tView = view.tView;
|
|
13227
12161
|
var destroyHooks;
|
|
13228
12162
|
if (tView != null && (destroyHooks = tView.destroyHooks) != null) {
|
|
13229
|
-
callHooks(
|
|
12163
|
+
callHooks(view.directives, destroyHooks);
|
|
13230
12164
|
}
|
|
13231
12165
|
}
|
|
13232
12166
|
/** Calls pipe destroy hooks for this view */
|
|
13233
12167
|
function executePipeOnDestroys(view) {
|
|
13234
12168
|
var pipeDestroyHooks = view.tView && view.tView.pipeDestroyHooks;
|
|
13235
12169
|
if (pipeDestroyHooks) {
|
|
13236
|
-
callHooks(
|
|
12170
|
+
callHooks(view.data, pipeDestroyHooks);
|
|
13237
12171
|
}
|
|
13238
12172
|
}
|
|
13239
12173
|
/**
|
|
@@ -13287,13 +12221,13 @@ function appendChild(parent, child, currentView) {
|
|
|
13287
12221
|
* @param currentView Current LView
|
|
13288
12222
|
*/
|
|
13289
12223
|
function insertChild(node, currentView) {
|
|
13290
|
-
var parent =
|
|
12224
|
+
var parent = node.parent;
|
|
13291
12225
|
if (canInsertNativeNode(parent, currentView)) {
|
|
13292
12226
|
var nativeSibling = findNextRNodeSibling(node, null);
|
|
13293
12227
|
var renderer = currentView.renderer;
|
|
13294
12228
|
isProceduralRenderer(renderer) ?
|
|
13295
|
-
renderer.insertBefore(
|
|
13296
|
-
parent.native.insertBefore(
|
|
12229
|
+
renderer.insertBefore(parent.native, node.native, nativeSibling) :
|
|
12230
|
+
parent.native.insertBefore(node.native, nativeSibling, false);
|
|
13297
12231
|
}
|
|
13298
12232
|
}
|
|
13299
12233
|
/**
|
|
@@ -13355,7 +12289,7 @@ function isCssClassMatching(nodeClassAttrVal, cssClassToMatch) {
|
|
|
13355
12289
|
function isNodeMatchingSelector(tNode, selector) {
|
|
13356
12290
|
ngDevMode && assertNotNull(selector[0], 'Selector should have a tag name');
|
|
13357
12291
|
var mode = 4;
|
|
13358
|
-
var nodeAttrs =
|
|
12292
|
+
var nodeAttrs = tNode.attrs;
|
|
13359
12293
|
// When processing ":not" selectors, we skip to the next ":not" if the
|
|
13360
12294
|
// current one doesn't match
|
|
13361
12295
|
var skipToNextSelector = false;
|
|
@@ -13564,7 +12498,7 @@ var tData;
|
|
|
13564
12498
|
* as we enter the view. Declaring the type as `null` would require us to place `!`
|
|
13565
12499
|
* in most instructions since they all assume that `currentView` is defined.
|
|
13566
12500
|
*/
|
|
13567
|
-
var currentView =
|
|
12501
|
+
var currentView = null;
|
|
13568
12502
|
var currentQueries;
|
|
13569
12503
|
function getCurrentQueries(QueryType) {
|
|
13570
12504
|
// top level variables should not be exported for performance reason (PERF_NOTES.md)
|
|
@@ -13654,7 +12588,7 @@ function enterView(newView, host) {
|
|
|
13654
12588
|
*/
|
|
13655
12589
|
function leaveView(newView) {
|
|
13656
12590
|
if (!checkNoChangesMode) {
|
|
13657
|
-
executeHooks(
|
|
12591
|
+
executeHooks(directives, currentView.tView.viewHooks, currentView.tView.viewCheckHooks, creationMode);
|
|
13658
12592
|
}
|
|
13659
12593
|
// Views should be clean and in update mode after being checked, so these bits are cleared
|
|
13660
12594
|
currentView.flags &= ~(1 /* CreationMode */ | 4 /* Dirty */);
|
|
@@ -13674,7 +12608,7 @@ function refreshDirectives() {
|
|
|
13674
12608
|
/** Sets the host bindings for the current view. */
|
|
13675
12609
|
function setHostBindings(bindings) {
|
|
13676
12610
|
if (bindings != null) {
|
|
13677
|
-
var defs =
|
|
12611
|
+
var defs = currentView.tView.directives;
|
|
13678
12612
|
for (var i = 0; i < bindings.length; i += 2) {
|
|
13679
12613
|
var dirIndex = bindings[i];
|
|
13680
12614
|
var def = defs[dirIndex];
|
|
@@ -13694,17 +12628,15 @@ function executeInitAndContentHooks() {
|
|
|
13694
12628
|
if (!checkNoChangesMode) {
|
|
13695
12629
|
var tView = currentView.tView;
|
|
13696
12630
|
executeInitHooks(currentView, tView, creationMode);
|
|
13697
|
-
executeHooks(
|
|
12631
|
+
executeHooks(directives, tView.contentHooks, tView.contentCheckHooks, creationMode);
|
|
13698
12632
|
}
|
|
13699
12633
|
}
|
|
13700
12634
|
function createLView(viewId, renderer, tView, template, context, flags) {
|
|
13701
12635
|
var newView = {
|
|
13702
12636
|
parent: currentView,
|
|
13703
12637
|
id: viewId,
|
|
13704
|
-
// -1 for component views
|
|
13705
12638
|
flags: flags | 1 /* CreationMode */ | 8 /* Attached */,
|
|
13706
|
-
node:
|
|
13707
|
-
// until we initialize it in createNode.
|
|
12639
|
+
node: null,
|
|
13708
12640
|
data: [],
|
|
13709
12641
|
directives: null,
|
|
13710
12642
|
tView: tView,
|
|
@@ -13794,12 +12726,15 @@ function createLNode(index, type, native, state) {
|
|
|
13794
12726
|
isParent = true;
|
|
13795
12727
|
return node;
|
|
13796
12728
|
}
|
|
12729
|
+
//////////////////////////
|
|
12730
|
+
//// Render
|
|
12731
|
+
//////////////////////////
|
|
13797
12732
|
/**
|
|
13798
12733
|
* Resets the application state.
|
|
13799
12734
|
*/
|
|
13800
12735
|
function resetApplicationState() {
|
|
13801
12736
|
isParent = false;
|
|
13802
|
-
previousOrParentNode =
|
|
12737
|
+
previousOrParentNode = null;
|
|
13803
12738
|
}
|
|
13804
12739
|
/**
|
|
13805
12740
|
*
|
|
@@ -13818,7 +12753,7 @@ function renderEmbeddedTemplate(viewNode, template, context, renderer, directive
|
|
|
13818
12753
|
var oldView;
|
|
13819
12754
|
try {
|
|
13820
12755
|
isParent = true;
|
|
13821
|
-
previousOrParentNode =
|
|
12756
|
+
previousOrParentNode = null;
|
|
13822
12757
|
var rf = 2;
|
|
13823
12758
|
if (viewNode == null) {
|
|
13824
12759
|
var tView = getOrCreateTView(template, directives || null, pipes || null);
|
|
@@ -13832,7 +12767,7 @@ function renderEmbeddedTemplate(viewNode, template, context, renderer, directive
|
|
|
13832
12767
|
refreshDynamicChildren();
|
|
13833
12768
|
}
|
|
13834
12769
|
finally {
|
|
13835
|
-
leaveView(
|
|
12770
|
+
leaveView(oldView);
|
|
13836
12771
|
isParent = _isParent;
|
|
13837
12772
|
previousOrParentNode = _previousOrParentNode;
|
|
13838
12773
|
}
|
|
@@ -13845,7 +12780,7 @@ function renderComponentOrTemplate(node, hostView, componentOrContext, template)
|
|
|
13845
12780
|
rendererFactory.begin();
|
|
13846
12781
|
}
|
|
13847
12782
|
if (template) {
|
|
13848
|
-
template(getRenderFlags(hostView),
|
|
12783
|
+
template(getRenderFlags(hostView), componentOrContext);
|
|
13849
12784
|
refreshDynamicChildren();
|
|
13850
12785
|
refreshDirectives();
|
|
13851
12786
|
}
|
|
@@ -13877,6 +12812,9 @@ function getRenderFlags(view) {
|
|
|
13877
12812
|
return view.flags & 1 /* CreationMode */ ? 1 /* Create */ | 2 /* Update */ :
|
|
13878
12813
|
2 /* Update */;
|
|
13879
12814
|
}
|
|
12815
|
+
//////////////////////////
|
|
12816
|
+
//// Element
|
|
12817
|
+
//////////////////////////
|
|
13880
12818
|
/**
|
|
13881
12819
|
* Create DOM element. The instruction must later be followed by `elementEnd()` call.
|
|
13882
12820
|
*
|
|
@@ -13893,10 +12831,10 @@ function elementStart(index, name, attrs, localRefs) {
|
|
|
13893
12831
|
ngDevMode &&
|
|
13894
12832
|
assertEqual(currentView.bindingStartIndex, -1, 'elements should be created before any bindings');
|
|
13895
12833
|
var native = renderer.createElement(name);
|
|
13896
|
-
var node = createLNode(index, 3 /* Element */,
|
|
12834
|
+
var node = createLNode(index, 3 /* Element */, native, null);
|
|
13897
12835
|
if (attrs)
|
|
13898
12836
|
setUpAttributes(native, attrs);
|
|
13899
|
-
appendChild(
|
|
12837
|
+
appendChild(node.parent, native, currentView);
|
|
13900
12838
|
createDirectivesAndLocals(index, name, attrs, localRefs, null);
|
|
13901
12839
|
return native;
|
|
13902
12840
|
}
|
|
@@ -13939,7 +12877,7 @@ function findDirectiveMatches(tNode) {
|
|
|
13939
12877
|
if (registry) {
|
|
13940
12878
|
for (var i = 0; i < registry.length; i++) {
|
|
13941
12879
|
var def = registry[i];
|
|
13942
|
-
if (isNodeMatchingSelectorList(tNode,
|
|
12880
|
+
if (isNodeMatchingSelectorList(tNode, def.selectors)) {
|
|
13943
12881
|
if (def.template) {
|
|
13944
12882
|
if (tNode.flags & 4096 /* isComponent */)
|
|
13945
12883
|
throwMultipleComponentError(tNode);
|
|
@@ -13992,12 +12930,12 @@ function isComponent(tNode) {
|
|
|
13992
12930
|
* This function instantiates the given directives.
|
|
13993
12931
|
*/
|
|
13994
12932
|
function instantiateDirectivesDirectly() {
|
|
13995
|
-
var tNode =
|
|
12933
|
+
var tNode = previousOrParentNode.tNode;
|
|
13996
12934
|
var count = tNode.flags & 4095;
|
|
13997
12935
|
if (count > 0) {
|
|
13998
12936
|
var start = tNode.flags >> 13;
|
|
13999
12937
|
var end = start + count;
|
|
14000
|
-
var tDirectives =
|
|
12938
|
+
var tDirectives = currentView.tView.directives;
|
|
14001
12939
|
for (var i = start; i < end; i++) {
|
|
14002
12940
|
var def = tDirectives[i];
|
|
14003
12941
|
directiveCreate(i, def.factory(), def);
|
|
@@ -14166,7 +13104,7 @@ function listener(eventName, listenerFn, useCapture) {
|
|
|
14166
13104
|
native.addEventListener(eventName, wrappedListener, useCapture);
|
|
14167
13105
|
cleanupFns.push(eventName, native, wrappedListener, useCapture);
|
|
14168
13106
|
}
|
|
14169
|
-
var tNode =
|
|
13107
|
+
var tNode = node.tNode;
|
|
14170
13108
|
if (tNode.outputs === undefined) {
|
|
14171
13109
|
// if we create TNode here, inputs must be undefined so we know they still need to be
|
|
14172
13110
|
// checked
|
|
@@ -14184,7 +13122,7 @@ function listener(eventName, listenerFn, useCapture) {
|
|
|
14184
13122
|
*/
|
|
14185
13123
|
function createOutput(outputs, listener) {
|
|
14186
13124
|
for (var i = 0; i < outputs.length; i += 2) {
|
|
14187
|
-
ngDevMode && assertDataInRange(outputs[i],
|
|
13125
|
+
ngDevMode && assertDataInRange(outputs[i], directives);
|
|
14188
13126
|
var subscription = directives[outputs[i]][outputs[i + 1]].subscribe(listener);
|
|
14189
13127
|
cleanup.push(subscription.unsubscribe, subscription);
|
|
14190
13128
|
}
|
|
@@ -14196,7 +13134,7 @@ function elementEnd() {
|
|
|
14196
13134
|
}
|
|
14197
13135
|
else {
|
|
14198
13136
|
ngDevMode && assertHasParent();
|
|
14199
|
-
previousOrParentNode =
|
|
13137
|
+
previousOrParentNode = previousOrParentNode.parent;
|
|
14200
13138
|
}
|
|
14201
13139
|
ngDevMode && assertNodeType(previousOrParentNode, 3 /* Element */);
|
|
14202
13140
|
var queries = previousOrParentNode.queries;
|
|
@@ -14243,7 +13181,7 @@ function elementProperty(index, propName, value, sanitizer) {
|
|
|
14243
13181
|
if (value === NO_CHANGE)
|
|
14244
13182
|
return;
|
|
14245
13183
|
var node = data[index];
|
|
14246
|
-
var tNode =
|
|
13184
|
+
var tNode = node.tNode;
|
|
14247
13185
|
// if tNode.inputs is undefined, a listener has created outputs, but inputs haven't
|
|
14248
13186
|
// yet been checked
|
|
14249
13187
|
if (tNode && tNode.inputs === undefined) {
|
|
@@ -14293,7 +13231,7 @@ function createTNode(tagName, attrs, data) {
|
|
|
14293
13231
|
*/
|
|
14294
13232
|
function setInputsForProperty(inputs, value) {
|
|
14295
13233
|
for (var i = 0; i < inputs.length; i += 2) {
|
|
14296
|
-
ngDevMode && assertDataInRange(inputs[i],
|
|
13234
|
+
ngDevMode && assertDataInRange(inputs[i], directives);
|
|
14297
13235
|
directives[inputs[i]][inputs[i + 1]] = value;
|
|
14298
13236
|
}
|
|
14299
13237
|
}
|
|
@@ -14311,7 +13249,7 @@ function generatePropertyAliases(tNodeFlags, direction) {
|
|
|
14311
13249
|
var start = tNodeFlags >> 13;
|
|
14312
13250
|
var end = start + count;
|
|
14313
13251
|
var isInput = direction === 0;
|
|
14314
|
-
var defs =
|
|
13252
|
+
var defs = currentView.tView.directives;
|
|
14315
13253
|
for (var i = start; i < end; i++) {
|
|
14316
13254
|
var directiveDef = defs[i];
|
|
14317
13255
|
var propertyAliasMap = isInput ? directiveDef.inputs : directiveDef.outputs;
|
|
@@ -14423,6 +13361,9 @@ function elementStyle(index, value) {
|
|
|
14423
13361
|
}
|
|
14424
13362
|
}
|
|
14425
13363
|
}
|
|
13364
|
+
//////////////////////////
|
|
13365
|
+
//// Text
|
|
13366
|
+
//////////////////////////
|
|
14426
13367
|
/**
|
|
14427
13368
|
* Create static text node
|
|
14428
13369
|
*
|
|
@@ -14437,7 +13378,7 @@ function text(index, value) {
|
|
|
14437
13378
|
var node = createLNode(index, 3 /* Element */, textNode);
|
|
14438
13379
|
// Text nodes are self closing.
|
|
14439
13380
|
isParent = false;
|
|
14440
|
-
appendChild(
|
|
13381
|
+
appendChild(node.parent, textNode, currentView);
|
|
14441
13382
|
}
|
|
14442
13383
|
/**
|
|
14443
13384
|
* Create text node with binding
|
|
@@ -14462,6 +13403,9 @@ function textBinding(index, value) {
|
|
|
14462
13403
|
insertChild(existingNode, currentView);
|
|
14463
13404
|
}
|
|
14464
13405
|
}
|
|
13406
|
+
//////////////////////////
|
|
13407
|
+
//// Directive
|
|
13408
|
+
//////////////////////////
|
|
14465
13409
|
/**
|
|
14466
13410
|
* Create a directive.
|
|
14467
13411
|
*
|
|
@@ -14520,9 +13464,6 @@ function baseDirectiveCreate(index, directive, directiveDef) {
|
|
|
14520
13464
|
if (firstTemplatePass) {
|
|
14521
13465
|
var flags = previousOrParentNode.tNode.flags;
|
|
14522
13466
|
if ((flags & 4095 /* DirectiveCountMask */) === 0) {
|
|
14523
|
-
// When the first directive is created:
|
|
14524
|
-
// - save the index,
|
|
14525
|
-
// - set the number of directives to 1
|
|
14526
13467
|
// When the first directive is created:
|
|
14527
13468
|
// - save the index,
|
|
14528
13469
|
// - set the number of directives to 1
|
|
@@ -14538,7 +13479,7 @@ function baseDirectiveCreate(index, directive, directiveDef) {
|
|
|
14538
13479
|
else {
|
|
14539
13480
|
var diPublic = directiveDef.diPublic;
|
|
14540
13481
|
if (diPublic)
|
|
14541
|
-
diPublic(
|
|
13482
|
+
diPublic(directiveDef);
|
|
14542
13483
|
}
|
|
14543
13484
|
if (directiveDef.attributes != null && previousOrParentNode.type == 3 /* Element */) {
|
|
14544
13485
|
setUpAttributes(previousOrParentNode.native, directiveDef.attributes);
|
|
@@ -14583,7 +13524,7 @@ function setInputsFromAttrs(directiveIndex, instance, inputs, tNode) {
|
|
|
14583
13524
|
function generateInitialInputs(directiveIndex, inputs, tNode) {
|
|
14584
13525
|
var initialInputData = tNode.initialInputs || (tNode.initialInputs = []);
|
|
14585
13526
|
initialInputData[directiveIndex] = null;
|
|
14586
|
-
var attrs =
|
|
13527
|
+
var attrs = tNode.attrs;
|
|
14587
13528
|
for (var i = 0; i < attrs.length; i += 2) {
|
|
14588
13529
|
var attrName = attrs[i];
|
|
14589
13530
|
var minifiedInputName = inputs[attrName];
|
|
@@ -14594,6 +13535,9 @@ function generateInitialInputs(directiveIndex, inputs, tNode) {
|
|
|
14594
13535
|
}
|
|
14595
13536
|
return initialInputData;
|
|
14596
13537
|
}
|
|
13538
|
+
//////////////////////////
|
|
13539
|
+
//// ViewContainer & View
|
|
13540
|
+
//////////////////////////
|
|
14597
13541
|
function createLContainer(parentLNode, currentView, template) {
|
|
14598
13542
|
ngDevMode && assertNotNull(parentLNode, 'containers should have a parent');
|
|
14599
13543
|
return {
|
|
@@ -14669,7 +13613,7 @@ function containerRefreshEnd() {
|
|
|
14669
13613
|
else {
|
|
14670
13614
|
ngDevMode && assertNodeType(previousOrParentNode, 2 /* View */);
|
|
14671
13615
|
ngDevMode && assertHasParent();
|
|
14672
|
-
previousOrParentNode =
|
|
13616
|
+
previousOrParentNode = previousOrParentNode.parent;
|
|
14673
13617
|
}
|
|
14674
13618
|
ngDevMode && assertNodeType(previousOrParentNode, 0 /* Container */);
|
|
14675
13619
|
var container = previousOrParentNode;
|
|
@@ -14688,7 +13632,7 @@ function refreshDynamicChildren() {
|
|
|
14688
13632
|
for (var i = 0; i < container_1.views.length; i++) {
|
|
14689
13633
|
var view = container_1.views[i];
|
|
14690
13634
|
// The directives and pipes are not needed here as an existing view is only being refreshed.
|
|
14691
|
-
renderEmbeddedTemplate(view,
|
|
13635
|
+
renderEmbeddedTemplate(view, view.data.template, view.data.context, renderer);
|
|
14692
13636
|
}
|
|
14693
13637
|
}
|
|
14694
13638
|
}
|
|
@@ -14789,7 +13733,7 @@ function embeddedViewEnd() {
|
|
|
14789
13733
|
}
|
|
14790
13734
|
lContainer.nextIndex++;
|
|
14791
13735
|
}
|
|
14792
|
-
leaveView(
|
|
13736
|
+
leaveView(currentView.parent);
|
|
14793
13737
|
ngDevMode && assertEqual(isParent, false, 'isParent');
|
|
14794
13738
|
ngDevMode && assertNodeType(previousOrParentNode, 2 /* View */);
|
|
14795
13739
|
}
|
|
@@ -14817,6 +13761,7 @@ function setRenderParentInProjectedNodes(renderParent, viewNode) {
|
|
|
14817
13761
|
}
|
|
14818
13762
|
}
|
|
14819
13763
|
}
|
|
13764
|
+
/////////////
|
|
14820
13765
|
/**
|
|
14821
13766
|
* Refreshes components by entering the component view and processing its bindings, queries, etc.
|
|
14822
13767
|
*
|
|
@@ -14828,10 +13773,10 @@ function componentRefresh(directiveIndex, elementIndex) {
|
|
|
14828
13773
|
var element = data[elementIndex];
|
|
14829
13774
|
ngDevMode && assertNodeType(element, 3 /* Element */);
|
|
14830
13775
|
ngDevMode && assertNotNull(element.data, "Component's host node should have an LView attached.");
|
|
14831
|
-
var hostView =
|
|
13776
|
+
var hostView = element.data;
|
|
14832
13777
|
// Only attached CheckAlways components or attached, dirty OnPush components should be checked
|
|
14833
13778
|
if (viewAttached(hostView) && hostView.flags & (2 /* CheckAlways */ | 4 /* Dirty */)) {
|
|
14834
|
-
ngDevMode && assertDataInRange(directiveIndex,
|
|
13779
|
+
ngDevMode && assertDataInRange(directiveIndex, directives);
|
|
14835
13780
|
var def = currentView.tView.directives[directiveIndex];
|
|
14836
13781
|
detectChangesInternal(hostView, element, def, getDirectiveInstance(directives[directiveIndex]));
|
|
14837
13782
|
}
|
|
@@ -14874,7 +13819,7 @@ function projectionDef(index, selectors, textSelectors) {
|
|
|
14874
13819
|
// - there are selectors defined
|
|
14875
13820
|
// - a node has a tag name / attributes that can be matched
|
|
14876
13821
|
if (selectors && componentChild.tNode) {
|
|
14877
|
-
var matchedIdx = matchingSelectorIndex(componentChild.tNode, selectors,
|
|
13822
|
+
var matchedIdx = matchingSelectorIndex(componentChild.tNode, selectors, textSelectors);
|
|
14878
13823
|
distributedNodes[matchedIdx].push(componentChild);
|
|
14879
13824
|
}
|
|
14880
13825
|
else {
|
|
@@ -14961,7 +13906,7 @@ function findComponentHost(lView) {
|
|
|
14961
13906
|
var viewRootLNode = lView.node;
|
|
14962
13907
|
while (viewRootLNode.type === 2 /* View */) {
|
|
14963
13908
|
ngDevMode && assertNotNull(lView.parent, 'lView.parent');
|
|
14964
|
-
lView =
|
|
13909
|
+
lView = lView.parent;
|
|
14965
13910
|
viewRootLNode = lView.node;
|
|
14966
13911
|
}
|
|
14967
13912
|
ngDevMode && assertNodeType(viewRootLNode, 3 /* Element */);
|
|
@@ -14983,6 +13928,9 @@ function addToViewTree(currentView, state) {
|
|
|
14983
13928
|
currentView.tail = state;
|
|
14984
13929
|
return state;
|
|
14985
13930
|
}
|
|
13931
|
+
///////////////////////////////
|
|
13932
|
+
//// Change detection
|
|
13933
|
+
///////////////////////////////
|
|
14986
13934
|
/** If node is an OnPush component, marks its LView dirty. */
|
|
14987
13935
|
function markDirtyIfOnPush(node) {
|
|
14988
13936
|
// Because data flows down the component tree, ancestors do not need to be marked dirty
|
|
@@ -15294,7 +14242,7 @@ function load(index) {
|
|
|
15294
14242
|
/** Retrieves a value from the `directives` array. */
|
|
15295
14243
|
function loadDirective(index) {
|
|
15296
14244
|
ngDevMode && assertNotNull(directives, 'Directives array should be defined if reading a dir.');
|
|
15297
|
-
ngDevMode && assertDataInRange(index,
|
|
14245
|
+
ngDevMode && assertDataInRange(index, directives);
|
|
15298
14246
|
return directives[index];
|
|
15299
14247
|
}
|
|
15300
14248
|
/** Gets the current binding value and increments the binding index. */
|
|
@@ -15378,12 +14326,10 @@ var ROOT_DIRECTIVE_INDICES = _ROOT_DIRECTIVE_INDICES;
|
|
|
15378
14326
|
var ViewRef$1 = /** @class */ (function () {
|
|
15379
14327
|
function ViewRef(_view, context) {
|
|
15380
14328
|
this._view = _view;
|
|
15381
|
-
this.context =
|
|
14329
|
+
this.context = context;
|
|
15382
14330
|
}
|
|
15383
14331
|
/** @internal */
|
|
15384
|
-
|
|
15385
|
-
ViewRef.prototype._setComponentContext = /** @internal */
|
|
15386
|
-
function (view, context) {
|
|
14332
|
+
ViewRef.prototype._setComponentContext = function (view, context) {
|
|
15387
14333
|
this._view = view;
|
|
15388
14334
|
this.context = context;
|
|
15389
14335
|
};
|
|
@@ -15401,7 +14347,8 @@ var ViewRef$1 = /** @class */ (function () {
|
|
|
15401
14347
|
*
|
|
15402
14348
|
* <!-- TODO: Add a link to a chapter on OnPush components -->
|
|
15403
14349
|
*
|
|
15404
|
-
*
|
|
14350
|
+
* @usageNotes
|
|
14351
|
+
* ### Example
|
|
15405
14352
|
*
|
|
15406
14353
|
* ```typescript
|
|
15407
14354
|
* @Component({
|
|
@@ -15422,73 +14369,7 @@ var ViewRef$1 = /** @class */ (function () {
|
|
|
15422
14369
|
* }
|
|
15423
14370
|
* ```
|
|
15424
14371
|
*/
|
|
15425
|
-
|
|
15426
|
-
* Marks a view and all of its ancestors dirty.
|
|
15427
|
-
*
|
|
15428
|
-
* It also triggers change detection by calling `scheduleTick` internally, which coalesces
|
|
15429
|
-
* multiple `markForCheck` calls to into one change detection run.
|
|
15430
|
-
*
|
|
15431
|
-
* This can be used to ensure an {@link ChangeDetectionStrategy#OnPush OnPush} component is
|
|
15432
|
-
* checked when it needs to be re-rendered but the two normal triggers haven't marked it
|
|
15433
|
-
* dirty (i.e. inputs haven't changed and events haven't fired in the view).
|
|
15434
|
-
*
|
|
15435
|
-
* <!-- TODO: Add a link to a chapter on OnPush components -->
|
|
15436
|
-
*
|
|
15437
|
-
* ### Example ([live demo](https://stackblitz.com/edit/angular-kx7rrw))
|
|
15438
|
-
*
|
|
15439
|
-
* ```typescript
|
|
15440
|
-
* @Component({
|
|
15441
|
-
* selector: 'my-app',
|
|
15442
|
-
* template: `Number of ticks: {{numberOfTicks}}`
|
|
15443
|
-
* changeDetection: ChangeDetectionStrategy.OnPush,
|
|
15444
|
-
* })
|
|
15445
|
-
* class AppComponent {
|
|
15446
|
-
* numberOfTicks = 0;
|
|
15447
|
-
*
|
|
15448
|
-
* constructor(private ref: ChangeDetectorRef) {
|
|
15449
|
-
* setInterval(() => {
|
|
15450
|
-
* this.numberOfTicks++;
|
|
15451
|
-
* // the following is required, otherwise the view will not be updated
|
|
15452
|
-
* this.ref.markForCheck();
|
|
15453
|
-
* }, 1000);
|
|
15454
|
-
* }
|
|
15455
|
-
* }
|
|
15456
|
-
* ```
|
|
15457
|
-
*/
|
|
15458
|
-
ViewRef.prototype.markForCheck = /**
|
|
15459
|
-
* Marks a view and all of its ancestors dirty.
|
|
15460
|
-
*
|
|
15461
|
-
* It also triggers change detection by calling `scheduleTick` internally, which coalesces
|
|
15462
|
-
* multiple `markForCheck` calls to into one change detection run.
|
|
15463
|
-
*
|
|
15464
|
-
* This can be used to ensure an {@link ChangeDetectionStrategy#OnPush OnPush} component is
|
|
15465
|
-
* checked when it needs to be re-rendered but the two normal triggers haven't marked it
|
|
15466
|
-
* dirty (i.e. inputs haven't changed and events haven't fired in the view).
|
|
15467
|
-
*
|
|
15468
|
-
* <!-- TODO: Add a link to a chapter on OnPush components -->
|
|
15469
|
-
*
|
|
15470
|
-
* ### Example ([live demo](https://stackblitz.com/edit/angular-kx7rrw))
|
|
15471
|
-
*
|
|
15472
|
-
* ```typescript
|
|
15473
|
-
* @Component({
|
|
15474
|
-
* selector: 'my-app',
|
|
15475
|
-
* template: `Number of ticks: {{numberOfTicks}}`
|
|
15476
|
-
* changeDetection: ChangeDetectionStrategy.OnPush,
|
|
15477
|
-
* })
|
|
15478
|
-
* class AppComponent {
|
|
15479
|
-
* numberOfTicks = 0;
|
|
15480
|
-
*
|
|
15481
|
-
* constructor(private ref: ChangeDetectorRef) {
|
|
15482
|
-
* setInterval(() => {
|
|
15483
|
-
* this.numberOfTicks++;
|
|
15484
|
-
* // the following is required, otherwise the view will not be updated
|
|
15485
|
-
* this.ref.markForCheck();
|
|
15486
|
-
* }, 1000);
|
|
15487
|
-
* }
|
|
15488
|
-
* }
|
|
15489
|
-
* ```
|
|
15490
|
-
*/
|
|
15491
|
-
function () { markViewDirty(this._view); };
|
|
14372
|
+
ViewRef.prototype.markForCheck = function () { markViewDirty(this._view); };
|
|
15492
14373
|
/**
|
|
15493
14374
|
* Detaches the view from the change detection tree.
|
|
15494
14375
|
*
|
|
@@ -15500,6 +14381,7 @@ var ViewRef$1 = /** @class */ (function () {
|
|
|
15500
14381
|
* <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
|
|
15501
14382
|
* <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
|
|
15502
14383
|
*
|
|
14384
|
+
* @usageNotes
|
|
15503
14385
|
* ### Example
|
|
15504
14386
|
*
|
|
15505
14387
|
* The following example defines a component with a large list of readonly data.
|
|
@@ -15541,111 +14423,7 @@ var ViewRef$1 = /** @class */ (function () {
|
|
|
15541
14423
|
* }
|
|
15542
14424
|
* ```
|
|
15543
14425
|
*/
|
|
15544
|
-
|
|
15545
|
-
* Detaches the view from the change detection tree.
|
|
15546
|
-
*
|
|
15547
|
-
* Detached views will not be checked during change detection runs until they are
|
|
15548
|
-
* re-attached, even if they are dirty. `detach` can be used in combination with
|
|
15549
|
-
* {@link ChangeDetectorRef#detectChanges detectChanges} to implement local change
|
|
15550
|
-
* detection checks.
|
|
15551
|
-
*
|
|
15552
|
-
* <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
|
|
15553
|
-
* <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
|
|
15554
|
-
*
|
|
15555
|
-
* ### Example
|
|
15556
|
-
*
|
|
15557
|
-
* The following example defines a component with a large list of readonly data.
|
|
15558
|
-
* Imagine the data changes constantly, many times per second. For performance reasons,
|
|
15559
|
-
* we want to check and update the list every five seconds. We can do that by detaching
|
|
15560
|
-
* the component's change detector and doing a local check every five seconds.
|
|
15561
|
-
*
|
|
15562
|
-
* ```typescript
|
|
15563
|
-
* class DataProvider {
|
|
15564
|
-
* // in a real application the returned data will be different every time
|
|
15565
|
-
* get data() {
|
|
15566
|
-
* return [1,2,3,4,5];
|
|
15567
|
-
* }
|
|
15568
|
-
* }
|
|
15569
|
-
*
|
|
15570
|
-
* @Component({
|
|
15571
|
-
* selector: 'giant-list',
|
|
15572
|
-
* template: `
|
|
15573
|
-
* <li *ngFor="let d of dataProvider.data">Data {{d}}</li>
|
|
15574
|
-
* `,
|
|
15575
|
-
* })
|
|
15576
|
-
* class GiantList {
|
|
15577
|
-
* constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {
|
|
15578
|
-
* ref.detach();
|
|
15579
|
-
* setInterval(() => {
|
|
15580
|
-
* this.ref.detectChanges();
|
|
15581
|
-
* }, 5000);
|
|
15582
|
-
* }
|
|
15583
|
-
* }
|
|
15584
|
-
*
|
|
15585
|
-
* @Component({
|
|
15586
|
-
* selector: 'app',
|
|
15587
|
-
* providers: [DataProvider],
|
|
15588
|
-
* template: `
|
|
15589
|
-
* <giant-list><giant-list>
|
|
15590
|
-
* `,
|
|
15591
|
-
* })
|
|
15592
|
-
* class App {
|
|
15593
|
-
* }
|
|
15594
|
-
* ```
|
|
15595
|
-
*/
|
|
15596
|
-
ViewRef.prototype.detach = /**
|
|
15597
|
-
* Detaches the view from the change detection tree.
|
|
15598
|
-
*
|
|
15599
|
-
* Detached views will not be checked during change detection runs until they are
|
|
15600
|
-
* re-attached, even if they are dirty. `detach` can be used in combination with
|
|
15601
|
-
* {@link ChangeDetectorRef#detectChanges detectChanges} to implement local change
|
|
15602
|
-
* detection checks.
|
|
15603
|
-
*
|
|
15604
|
-
* <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
|
|
15605
|
-
* <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
|
|
15606
|
-
*
|
|
15607
|
-
* ### Example
|
|
15608
|
-
*
|
|
15609
|
-
* The following example defines a component with a large list of readonly data.
|
|
15610
|
-
* Imagine the data changes constantly, many times per second. For performance reasons,
|
|
15611
|
-
* we want to check and update the list every five seconds. We can do that by detaching
|
|
15612
|
-
* the component's change detector and doing a local check every five seconds.
|
|
15613
|
-
*
|
|
15614
|
-
* ```typescript
|
|
15615
|
-
* class DataProvider {
|
|
15616
|
-
* // in a real application the returned data will be different every time
|
|
15617
|
-
* get data() {
|
|
15618
|
-
* return [1,2,3,4,5];
|
|
15619
|
-
* }
|
|
15620
|
-
* }
|
|
15621
|
-
*
|
|
15622
|
-
* @Component({
|
|
15623
|
-
* selector: 'giant-list',
|
|
15624
|
-
* template: `
|
|
15625
|
-
* <li *ngFor="let d of dataProvider.data">Data {{d}}</li>
|
|
15626
|
-
* `,
|
|
15627
|
-
* })
|
|
15628
|
-
* class GiantList {
|
|
15629
|
-
* constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {
|
|
15630
|
-
* ref.detach();
|
|
15631
|
-
* setInterval(() => {
|
|
15632
|
-
* this.ref.detectChanges();
|
|
15633
|
-
* }, 5000);
|
|
15634
|
-
* }
|
|
15635
|
-
* }
|
|
15636
|
-
*
|
|
15637
|
-
* @Component({
|
|
15638
|
-
* selector: 'app',
|
|
15639
|
-
* providers: [DataProvider],
|
|
15640
|
-
* template: `
|
|
15641
|
-
* <giant-list><giant-list>
|
|
15642
|
-
* `,
|
|
15643
|
-
* })
|
|
15644
|
-
* class App {
|
|
15645
|
-
* }
|
|
15646
|
-
* ```
|
|
15647
|
-
*/
|
|
15648
|
-
function () { this._view.flags &= ~8 /* Attached */; };
|
|
14426
|
+
ViewRef.prototype.detach = function () { this._view.flags &= ~8 /* Attached */; };
|
|
15649
14427
|
/**
|
|
15650
14428
|
* Re-attaches a view to the change detection tree.
|
|
15651
14429
|
*
|
|
@@ -15654,7 +14432,8 @@ var ViewRef$1 = /** @class */ (function () {
|
|
|
15654
14432
|
*
|
|
15655
14433
|
* <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
|
|
15656
14434
|
*
|
|
15657
|
-
*
|
|
14435
|
+
* @usageNotes
|
|
14436
|
+
* ### Example
|
|
15658
14437
|
*
|
|
15659
14438
|
* The following example creates a component displaying `live` data. The component will detach
|
|
15660
14439
|
* its change detector from the main change detector tree when the component's live property
|
|
@@ -15701,117 +14480,7 @@ var ViewRef$1 = /** @class */ (function () {
|
|
|
15701
14480
|
* }
|
|
15702
14481
|
* ```
|
|
15703
14482
|
*/
|
|
15704
|
-
|
|
15705
|
-
* Re-attaches a view to the change detection tree.
|
|
15706
|
-
*
|
|
15707
|
-
* This can be used to re-attach views that were previously detached from the tree
|
|
15708
|
-
* using {@link ChangeDetectorRef#detach detach}. Views are attached to the tree by default.
|
|
15709
|
-
*
|
|
15710
|
-
* <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
|
|
15711
|
-
*
|
|
15712
|
-
* ### Example ([live demo](https://stackblitz.com/edit/angular-ymgsxw))
|
|
15713
|
-
*
|
|
15714
|
-
* The following example creates a component displaying `live` data. The component will detach
|
|
15715
|
-
* its change detector from the main change detector tree when the component's live property
|
|
15716
|
-
* is set to false.
|
|
15717
|
-
*
|
|
15718
|
-
* ```typescript
|
|
15719
|
-
* class DataProvider {
|
|
15720
|
-
* data = 1;
|
|
15721
|
-
*
|
|
15722
|
-
* constructor() {
|
|
15723
|
-
* setInterval(() => {
|
|
15724
|
-
* this.data = this.data * 2;
|
|
15725
|
-
* }, 500);
|
|
15726
|
-
* }
|
|
15727
|
-
* }
|
|
15728
|
-
*
|
|
15729
|
-
* @Component({
|
|
15730
|
-
* selector: 'live-data',
|
|
15731
|
-
* inputs: ['live'],
|
|
15732
|
-
* template: 'Data: {{dataProvider.data}}'
|
|
15733
|
-
* })
|
|
15734
|
-
* class LiveData {
|
|
15735
|
-
* constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {}
|
|
15736
|
-
*
|
|
15737
|
-
* set live(value) {
|
|
15738
|
-
* if (value) {
|
|
15739
|
-
* this.ref.reattach();
|
|
15740
|
-
* } else {
|
|
15741
|
-
* this.ref.detach();
|
|
15742
|
-
* }
|
|
15743
|
-
* }
|
|
15744
|
-
* }
|
|
15745
|
-
*
|
|
15746
|
-
* @Component({
|
|
15747
|
-
* selector: 'my-app',
|
|
15748
|
-
* providers: [DataProvider],
|
|
15749
|
-
* template: `
|
|
15750
|
-
* Live Update: <input type="checkbox" [(ngModel)]="live">
|
|
15751
|
-
* <live-data [live]="live"><live-data>
|
|
15752
|
-
* `,
|
|
15753
|
-
* })
|
|
15754
|
-
* class AppComponent {
|
|
15755
|
-
* live = true;
|
|
15756
|
-
* }
|
|
15757
|
-
* ```
|
|
15758
|
-
*/
|
|
15759
|
-
ViewRef.prototype.reattach = /**
|
|
15760
|
-
* Re-attaches a view to the change detection tree.
|
|
15761
|
-
*
|
|
15762
|
-
* This can be used to re-attach views that were previously detached from the tree
|
|
15763
|
-
* using {@link ChangeDetectorRef#detach detach}. Views are attached to the tree by default.
|
|
15764
|
-
*
|
|
15765
|
-
* <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
|
|
15766
|
-
*
|
|
15767
|
-
* ### Example ([live demo](https://stackblitz.com/edit/angular-ymgsxw))
|
|
15768
|
-
*
|
|
15769
|
-
* The following example creates a component displaying `live` data. The component will detach
|
|
15770
|
-
* its change detector from the main change detector tree when the component's live property
|
|
15771
|
-
* is set to false.
|
|
15772
|
-
*
|
|
15773
|
-
* ```typescript
|
|
15774
|
-
* class DataProvider {
|
|
15775
|
-
* data = 1;
|
|
15776
|
-
*
|
|
15777
|
-
* constructor() {
|
|
15778
|
-
* setInterval(() => {
|
|
15779
|
-
* this.data = this.data * 2;
|
|
15780
|
-
* }, 500);
|
|
15781
|
-
* }
|
|
15782
|
-
* }
|
|
15783
|
-
*
|
|
15784
|
-
* @Component({
|
|
15785
|
-
* selector: 'live-data',
|
|
15786
|
-
* inputs: ['live'],
|
|
15787
|
-
* template: 'Data: {{dataProvider.data}}'
|
|
15788
|
-
* })
|
|
15789
|
-
* class LiveData {
|
|
15790
|
-
* constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {}
|
|
15791
|
-
*
|
|
15792
|
-
* set live(value) {
|
|
15793
|
-
* if (value) {
|
|
15794
|
-
* this.ref.reattach();
|
|
15795
|
-
* } else {
|
|
15796
|
-
* this.ref.detach();
|
|
15797
|
-
* }
|
|
15798
|
-
* }
|
|
15799
|
-
* }
|
|
15800
|
-
*
|
|
15801
|
-
* @Component({
|
|
15802
|
-
* selector: 'my-app',
|
|
15803
|
-
* providers: [DataProvider],
|
|
15804
|
-
* template: `
|
|
15805
|
-
* Live Update: <input type="checkbox" [(ngModel)]="live">
|
|
15806
|
-
* <live-data [live]="live"><live-data>
|
|
15807
|
-
* `,
|
|
15808
|
-
* })
|
|
15809
|
-
* class AppComponent {
|
|
15810
|
-
* live = true;
|
|
15811
|
-
* }
|
|
15812
|
-
* ```
|
|
15813
|
-
*/
|
|
15814
|
-
function () { this._view.flags |= 8 /* Attached */; };
|
|
14483
|
+
ViewRef.prototype.reattach = function () { this._view.flags |= 8 /* Attached */; };
|
|
15815
14484
|
/**
|
|
15816
14485
|
* Checks the view and its children.
|
|
15817
14486
|
*
|
|
@@ -15821,6 +14490,7 @@ var ViewRef$1 = /** @class */ (function () {
|
|
|
15821
14490
|
* <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
|
|
15822
14491
|
* <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
|
|
15823
14492
|
*
|
|
14493
|
+
* @usageNotes
|
|
15824
14494
|
* ### Example
|
|
15825
14495
|
*
|
|
15826
14496
|
* The following example defines a component with a large list of readonly data.
|
|
@@ -15832,66 +14502,14 @@ var ViewRef$1 = /** @class */ (function () {
|
|
|
15832
14502
|
*
|
|
15833
14503
|
* See {@link ChangeDetectorRef#detach detach} for more information.
|
|
15834
14504
|
*/
|
|
15835
|
-
|
|
15836
|
-
* Checks the view and its children.
|
|
15837
|
-
*
|
|
15838
|
-
* This can also be used in combination with {@link ChangeDetectorRef#detach detach} to implement
|
|
15839
|
-
* local change detection checks.
|
|
15840
|
-
*
|
|
15841
|
-
* <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
|
|
15842
|
-
* <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
|
|
15843
|
-
*
|
|
15844
|
-
* ### Example
|
|
15845
|
-
*
|
|
15846
|
-
* The following example defines a component with a large list of readonly data.
|
|
15847
|
-
* Imagine, the data changes constantly, many times per second. For performance reasons,
|
|
15848
|
-
* we want to check and update the list every five seconds.
|
|
15849
|
-
*
|
|
15850
|
-
* We can do that by detaching the component's change detector and doing a local change detection
|
|
15851
|
-
* check every five seconds.
|
|
15852
|
-
*
|
|
15853
|
-
* See {@link ChangeDetectorRef#detach detach} for more information.
|
|
15854
|
-
*/
|
|
15855
|
-
ViewRef.prototype.detectChanges = /**
|
|
15856
|
-
* Checks the view and its children.
|
|
15857
|
-
*
|
|
15858
|
-
* This can also be used in combination with {@link ChangeDetectorRef#detach detach} to implement
|
|
15859
|
-
* local change detection checks.
|
|
15860
|
-
*
|
|
15861
|
-
* <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
|
|
15862
|
-
* <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
|
|
15863
|
-
*
|
|
15864
|
-
* ### Example
|
|
15865
|
-
*
|
|
15866
|
-
* The following example defines a component with a large list of readonly data.
|
|
15867
|
-
* Imagine, the data changes constantly, many times per second. For performance reasons,
|
|
15868
|
-
* we want to check and update the list every five seconds.
|
|
15869
|
-
*
|
|
15870
|
-
* We can do that by detaching the component's change detector and doing a local change detection
|
|
15871
|
-
* check every five seconds.
|
|
15872
|
-
*
|
|
15873
|
-
* See {@link ChangeDetectorRef#detach detach} for more information.
|
|
15874
|
-
*/
|
|
15875
|
-
function () { detectChanges(this.context); };
|
|
14505
|
+
ViewRef.prototype.detectChanges = function () { detectChanges(this.context); };
|
|
15876
14506
|
/**
|
|
15877
14507
|
* Checks the change detector and its children, and throws if any changes are detected.
|
|
15878
14508
|
*
|
|
15879
14509
|
* This is used in development mode to verify that running change detection doesn't
|
|
15880
14510
|
* introduce other changes.
|
|
15881
14511
|
*/
|
|
15882
|
-
|
|
15883
|
-
* Checks the change detector and its children, and throws if any changes are detected.
|
|
15884
|
-
*
|
|
15885
|
-
* This is used in development mode to verify that running change detection doesn't
|
|
15886
|
-
* introduce other changes.
|
|
15887
|
-
*/
|
|
15888
|
-
ViewRef.prototype.checkNoChanges = /**
|
|
15889
|
-
* Checks the change detector and its children, and throws if any changes are detected.
|
|
15890
|
-
*
|
|
15891
|
-
* This is used in development mode to verify that running change detection doesn't
|
|
15892
|
-
* introduce other changes.
|
|
15893
|
-
*/
|
|
15894
|
-
function () { checkNoChanges(this.context); };
|
|
14512
|
+
ViewRef.prototype.checkNoChanges = function () { checkNoChanges(this.context); };
|
|
15895
14513
|
return ViewRef;
|
|
15896
14514
|
}());
|
|
15897
14515
|
var EmbeddedViewRef$1 = /** @class */ (function (_super) {
|
|
@@ -15911,7 +14529,7 @@ var EmbeddedViewRef$1 = /** @class */ (function (_super) {
|
|
|
15911
14529
|
*/
|
|
15912
14530
|
function createViewRef(view, context) {
|
|
15913
14531
|
// TODO: add detectChanges back in when implementing ChangeDetectorRef.detectChanges
|
|
15914
|
-
return addDestroyable(new ViewRef$1(
|
|
14532
|
+
return addDestroyable(new ViewRef$1(view, context));
|
|
15915
14533
|
}
|
|
15916
14534
|
/**
|
|
15917
14535
|
* Decorates an object with destroy logic (implementing the DestroyRef interface)
|
|
@@ -15973,13 +14591,13 @@ function renderComponent(componentType /* Type as workaround for: Microsoft/Type
|
|
|
15973
14591
|
var hostNode = locateHostElement(rendererFactory, opts.host || componentTag);
|
|
15974
14592
|
var rootContext = {
|
|
15975
14593
|
// Incomplete initialization due to circular reference.
|
|
15976
|
-
component:
|
|
14594
|
+
component: null,
|
|
15977
14595
|
scheduler: opts.scheduler || requestAnimationFrame.bind(window),
|
|
15978
14596
|
clean: CLEAN_PROMISE,
|
|
15979
14597
|
};
|
|
15980
14598
|
var rootView = createLView(-1, rendererFactory.createRenderer(hostNode, componentDef.rendererType), createTView(null, null), null, rootContext, componentDef.onPush ? 4 /* Dirty */ : 2 /* CheckAlways */);
|
|
15981
14599
|
rootView.injector = opts.injector || null;
|
|
15982
|
-
var oldView = enterView(rootView,
|
|
14600
|
+
var oldView = enterView(rootView, null);
|
|
15983
14601
|
var elementNode;
|
|
15984
14602
|
try {
|
|
15985
14603
|
if (rendererFactory.begin)
|
|
@@ -15987,8 +14605,9 @@ function renderComponent(componentType /* Type as workaround for: Microsoft/Type
|
|
|
15987
14605
|
// Create element node at index 0 in data array
|
|
15988
14606
|
elementNode = hostElement(componentTag, hostNode, componentDef);
|
|
15989
14607
|
// Create directive instance with factory() and store at index 0 in directives array
|
|
15990
|
-
component = rootContext.component =
|
|
15991
|
-
|
|
14608
|
+
component = rootContext.component =
|
|
14609
|
+
baseDirectiveCreate(0, componentDef.factory(), componentDef);
|
|
14610
|
+
initChangeDetectorIfExisting(elementNode.nodeInjector, component, elementNode.data);
|
|
15992
14611
|
opts.hostFeatures && opts.hostFeatures.forEach(function (feature) { return feature(component, componentDef); });
|
|
15993
14612
|
executeInitAndContentHooks();
|
|
15994
14613
|
setHostBindings(ROOT_DIRECTIVE_INDICES);
|
|
@@ -16248,7 +14867,7 @@ function injectAttribute(attrName) {
|
|
|
16248
14867
|
ngDevMode && assertPreviousIsParent();
|
|
16249
14868
|
var lElement = getPreviousOrParentNode();
|
|
16250
14869
|
ngDevMode && assertNodeType(lElement, 3 /* Element */);
|
|
16251
|
-
var tElement =
|
|
14870
|
+
var tElement = lElement.tNode;
|
|
16252
14871
|
ngDevMode && assertNotNull(tElement, 'expecting tNode');
|
|
16253
14872
|
var attrs = tElement.attrs;
|
|
16254
14873
|
if (attrs) {
|
|
@@ -16270,7 +14889,7 @@ function getOrCreateChangeDetectorRef(di, context) {
|
|
|
16270
14889
|
if (di.changeDetectorRef)
|
|
16271
14890
|
return di.changeDetectorRef;
|
|
16272
14891
|
var currentNode = di.node;
|
|
16273
|
-
if (isComponent(
|
|
14892
|
+
if (isComponent(currentNode.tNode)) {
|
|
16274
14893
|
return di.changeDetectorRef = createViewRef(currentNode.data, context);
|
|
16275
14894
|
}
|
|
16276
14895
|
else if (currentNode.type === 3 /* Element */) {
|
|
@@ -16349,7 +14968,7 @@ function getOrCreateInjectable(di, token, flags) {
|
|
|
16349
14968
|
if (count !== 0) {
|
|
16350
14969
|
var start = flags_1 >> 13;
|
|
16351
14970
|
var end = start + count;
|
|
16352
|
-
var defs =
|
|
14971
|
+
var defs = node.view.tView.directives;
|
|
16353
14972
|
for (var i = start; i < end; i++) {
|
|
16354
14973
|
// Get the definition for the directive at this index and, if it is injectable (diPublic),
|
|
16355
14974
|
// and matches the given token, return the directive instance.
|
|
@@ -16500,8 +15119,8 @@ function getOrCreateContainerRef(di) {
|
|
|
16500
15119
|
if (!di.viewContainerRef) {
|
|
16501
15120
|
var vcRefHost = di.node;
|
|
16502
15121
|
ngDevMode && assertNodeOfPossibleTypes(vcRefHost, 0 /* Container */, 3 /* Element */);
|
|
16503
|
-
var lContainer = createLContainer(
|
|
16504
|
-
var lContainerNode = createLNodeObject(0 /* Container */, vcRefHost.view,
|
|
15122
|
+
var lContainer = createLContainer(vcRefHost.parent, vcRefHost.view);
|
|
15123
|
+
var lContainerNode = createLNodeObject(0 /* Container */, vcRefHost.view, vcRefHost.parent, undefined, lContainer, null);
|
|
16505
15124
|
vcRefHost.dynamicLContainerNode = lContainerNode;
|
|
16506
15125
|
addToViewTree(vcRefHost.view, lContainer);
|
|
16507
15126
|
di.viewContainerRef = new ViewContainerRef$1(lContainerNode);
|
|
@@ -16605,7 +15224,7 @@ function getOrCreateTemplateRef(di) {
|
|
|
16605
15224
|
ngDevMode && assertNodeType(di.node, 0 /* Container */);
|
|
16606
15225
|
var data = di.node.data;
|
|
16607
15226
|
var tView = di.node.view.tView;
|
|
16608
|
-
return di.templateRef || (di.templateRef = new TemplateRef$1(getOrCreateElementRef(di),
|
|
15227
|
+
return di.templateRef || (di.templateRef = new TemplateRef$1(getOrCreateElementRef(di), data.template, getRenderer(), tView.directiveRegistry, tView.pipeRegistry));
|
|
16609
15228
|
}
|
|
16610
15229
|
var TemplateRef$1 = /** @class */ (function () {
|
|
16611
15230
|
function TemplateRef(elementRef, template, _renderer, _directives, _pipes) {
|
|
@@ -16646,13 +15265,13 @@ var TemplateRef$1 = /** @class */ (function () {
|
|
|
16646
15265
|
*/
|
|
16647
15266
|
function defineComponent(componentDefinition) {
|
|
16648
15267
|
var type = componentDefinition.type;
|
|
16649
|
-
var pipeTypes =
|
|
16650
|
-
var directiveTypes =
|
|
15268
|
+
var pipeTypes = componentDefinition.pipes;
|
|
15269
|
+
var directiveTypes = componentDefinition.directives;
|
|
16651
15270
|
var def = {
|
|
16652
15271
|
type: type,
|
|
16653
15272
|
diPublic: null,
|
|
16654
15273
|
factory: componentDefinition.factory,
|
|
16655
|
-
template: componentDefinition.template ||
|
|
15274
|
+
template: componentDefinition.template || null,
|
|
16656
15275
|
hostBindings: componentDefinition.hostBindings || null,
|
|
16657
15276
|
attributes: componentDefinition.attributes || null,
|
|
16658
15277
|
inputs: invertObject(componentDefinition.inputs),
|
|
@@ -16668,10 +15287,8 @@ function defineComponent(componentDefinition) {
|
|
|
16668
15287
|
onDestroy: type.prototype.ngOnDestroy || null,
|
|
16669
15288
|
onPush: componentDefinition.changeDetection === exports.ChangeDetectionStrategy.OnPush,
|
|
16670
15289
|
directiveDefs: directiveTypes ?
|
|
16671
|
-
function () {
|
|
16672
|
-
|
|
16673
|
-
.map(extractDirectiveDef);
|
|
16674
|
-
} :
|
|
15290
|
+
function () { return (typeof directiveTypes === 'function' ? directiveTypes() : directiveTypes)
|
|
15291
|
+
.map(extractDirectiveDef); } :
|
|
16675
15292
|
null,
|
|
16676
15293
|
pipeDefs: pipeTypes ?
|
|
16677
15294
|
function () { return (typeof pipeTypes === 'function' ? pipeTypes() : pipeTypes).map(extractPipeDef); } :
|
|
@@ -17273,7 +15890,7 @@ function getIdxOfMatchingSelector(tNode, selector) {
|
|
|
17273
15890
|
* @returns Index of a found directive or null when none found.
|
|
17274
15891
|
*/
|
|
17275
15892
|
function getIdxOfMatchingDirective(node, type) {
|
|
17276
|
-
var defs =
|
|
15893
|
+
var defs = node.view.tView.directives;
|
|
17277
15894
|
var flags = node.tNode.flags;
|
|
17278
15895
|
var count = flags & 4095;
|
|
17279
15896
|
var start = flags >> 13;
|
|
@@ -17315,15 +15932,15 @@ function add(query, node) {
|
|
|
17315
15932
|
}
|
|
17316
15933
|
}
|
|
17317
15934
|
else {
|
|
17318
|
-
var selector =
|
|
15935
|
+
var selector = predicate.selector;
|
|
17319
15936
|
for (var i = 0; i < selector.length; i++) {
|
|
17320
15937
|
ngDevMode && assertNotNull(node.tNode, 'node.tNode');
|
|
17321
|
-
var directiveIdx = getIdxOfMatchingSelector(
|
|
15938
|
+
var directiveIdx = getIdxOfMatchingSelector(node.tNode, selector[i]);
|
|
17322
15939
|
if (directiveIdx !== null) {
|
|
17323
15940
|
// a node is matching a predicate - determine what to read
|
|
17324
15941
|
// note that queries using name selector must specify read strategy
|
|
17325
15942
|
ngDevMode && assertNotNull(predicate.read, 'the node should have a predicate');
|
|
17326
|
-
var result = readFromNodeInjector(nodeInjector, node,
|
|
15943
|
+
var result = readFromNodeInjector(nodeInjector, node, predicate.read, directiveIdx);
|
|
17327
15944
|
if (result !== null) {
|
|
17328
15945
|
addMatch(query, result);
|
|
17329
15946
|
}
|
|
@@ -17386,86 +16003,38 @@ var QueryList_ = /** @class */ (function () {
|
|
|
17386
16003
|
* See
|
|
17387
16004
|
* [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)
|
|
17388
16005
|
*/
|
|
17389
|
-
|
|
17390
|
-
* See
|
|
17391
|
-
* [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)
|
|
17392
|
-
*/
|
|
17393
|
-
QueryList_.prototype.map = /**
|
|
17394
|
-
* See
|
|
17395
|
-
* [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)
|
|
17396
|
-
*/
|
|
17397
|
-
function (fn) { return this._values.map(fn); };
|
|
16006
|
+
QueryList_.prototype.map = function (fn) { return this._values.map(fn); };
|
|
17398
16007
|
/**
|
|
17399
16008
|
* See
|
|
17400
16009
|
* [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)
|
|
17401
16010
|
*/
|
|
17402
|
-
|
|
17403
|
-
* See
|
|
17404
|
-
* [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)
|
|
17405
|
-
*/
|
|
17406
|
-
QueryList_.prototype.filter = /**
|
|
17407
|
-
* See
|
|
17408
|
-
* [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)
|
|
17409
|
-
*/
|
|
17410
|
-
function (fn) {
|
|
16011
|
+
QueryList_.prototype.filter = function (fn) {
|
|
17411
16012
|
return this._values.filter(fn);
|
|
17412
16013
|
};
|
|
17413
16014
|
/**
|
|
17414
16015
|
* See
|
|
17415
16016
|
* [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
|
|
17416
16017
|
*/
|
|
17417
|
-
|
|
17418
|
-
* See
|
|
17419
|
-
* [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
|
|
17420
|
-
*/
|
|
17421
|
-
QueryList_.prototype.find = /**
|
|
17422
|
-
* See
|
|
17423
|
-
* [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
|
|
17424
|
-
*/
|
|
17425
|
-
function (fn) {
|
|
16018
|
+
QueryList_.prototype.find = function (fn) {
|
|
17426
16019
|
return this._values.find(fn);
|
|
17427
16020
|
};
|
|
17428
16021
|
/**
|
|
17429
16022
|
* See
|
|
17430
16023
|
* [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)
|
|
17431
16024
|
*/
|
|
17432
|
-
|
|
17433
|
-
* See
|
|
17434
|
-
* [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)
|
|
17435
|
-
*/
|
|
17436
|
-
QueryList_.prototype.reduce = /**
|
|
17437
|
-
* See
|
|
17438
|
-
* [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)
|
|
17439
|
-
*/
|
|
17440
|
-
function (fn, init) {
|
|
16025
|
+
QueryList_.prototype.reduce = function (fn, init) {
|
|
17441
16026
|
return this._values.reduce(fn, init);
|
|
17442
16027
|
};
|
|
17443
16028
|
/**
|
|
17444
16029
|
* See
|
|
17445
16030
|
* [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)
|
|
17446
16031
|
*/
|
|
17447
|
-
|
|
17448
|
-
* See
|
|
17449
|
-
* [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)
|
|
17450
|
-
*/
|
|
17451
|
-
QueryList_.prototype.forEach = /**
|
|
17452
|
-
* See
|
|
17453
|
-
* [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)
|
|
17454
|
-
*/
|
|
17455
|
-
function (fn) { this._values.forEach(fn); };
|
|
16032
|
+
QueryList_.prototype.forEach = function (fn) { this._values.forEach(fn); };
|
|
17456
16033
|
/**
|
|
17457
16034
|
* See
|
|
17458
16035
|
* [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)
|
|
17459
16036
|
*/
|
|
17460
|
-
|
|
17461
|
-
* See
|
|
17462
|
-
* [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)
|
|
17463
|
-
*/
|
|
17464
|
-
QueryList_.prototype.some = /**
|
|
17465
|
-
* See
|
|
17466
|
-
* [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)
|
|
17467
|
-
*/
|
|
17468
|
-
function (fn) {
|
|
16037
|
+
QueryList_.prototype.some = function (fn) {
|
|
17469
16038
|
return this._values.some(fn);
|
|
17470
16039
|
};
|
|
17471
16040
|
QueryList_.prototype.toArray = function () { return this._values.slice(0); };
|
|
@@ -17692,6 +16261,7 @@ function bypassSanitizationTrustString(trustedString, mode) {
|
|
|
17692
16261
|
* Use of this source code is governed by an MIT-style license that can be
|
|
17693
16262
|
* found in the LICENSE file at https://angular.io/license
|
|
17694
16263
|
*/
|
|
16264
|
+
// clang-format off
|
|
17695
16265
|
|
|
17696
16266
|
// clang-format on
|
|
17697
16267
|
|
|
@@ -17710,6 +16280,11 @@ function bypassSanitizationTrustString(trustedString, mode) {
|
|
|
17710
16280
|
* Use of this source code is governed by an MIT-style license that can be
|
|
17711
16281
|
* found in the LICENSE file at https://angular.io/license
|
|
17712
16282
|
*/
|
|
16283
|
+
/**
|
|
16284
|
+
* @module
|
|
16285
|
+
* @description
|
|
16286
|
+
* Entry point from which you should import all public core APIs.
|
|
16287
|
+
*/
|
|
17713
16288
|
|
|
17714
16289
|
/**
|
|
17715
16290
|
* @license
|
|
@@ -17718,6 +16293,11 @@ function bypassSanitizationTrustString(trustedString, mode) {
|
|
|
17718
16293
|
* Use of this source code is governed by an MIT-style license that can be
|
|
17719
16294
|
* found in the LICENSE file at https://angular.io/license
|
|
17720
16295
|
*/
|
|
16296
|
+
/**
|
|
16297
|
+
* @module
|
|
16298
|
+
* @description
|
|
16299
|
+
* Entry point for all public APIs of this package.
|
|
16300
|
+
*/
|
|
17721
16301
|
|
|
17722
16302
|
// This file only reexports content of the `src` folder. Keep it that way.
|
|
17723
16303
|
|
|
@@ -17728,6 +16308,10 @@ function bypassSanitizationTrustString(trustedString, mode) {
|
|
|
17728
16308
|
* Use of this source code is governed by an MIT-style license that can be
|
|
17729
16309
|
* found in the LICENSE file at https://angular.io/license
|
|
17730
16310
|
*/
|
|
16311
|
+
// This file is not used to build this module. It is only used during editing
|
|
16312
|
+
// by the TypeScript language service and during build for verification. `ngc`
|
|
16313
|
+
// replaces this file with production index.ts when it rewrites private symbol
|
|
16314
|
+
// names.
|
|
17731
16315
|
|
|
17732
16316
|
/**
|
|
17733
16317
|
* Generated bundle index. Do not edit.
|