@angular/core 10.0.0 → 10.0.4

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.
Files changed (49) hide show
  1. package/bundles/core-testing.umd.js +321 -272
  2. package/bundles/core-testing.umd.js.map +1 -1
  3. package/bundles/core-testing.umd.min.js +11 -25
  4. package/bundles/core-testing.umd.min.js.map +1 -1
  5. package/bundles/core.umd.js +620 -832
  6. package/bundles/core.umd.js.map +1 -1
  7. package/bundles/core.umd.min.js +128 -282
  8. package/bundles/core.umd.min.js.map +1 -1
  9. package/core.d.ts +69 -65
  10. package/core.metadata.json +1 -1
  11. package/esm2015/src/application_init.js +9 -5
  12. package/esm2015/src/application_tokens.js +16 -12
  13. package/esm2015/src/change_detection/change_detector_ref.js +6 -3
  14. package/esm2015/src/change_detection/constants.js +3 -1
  15. package/esm2015/src/di/injectable.js +1 -1
  16. package/esm2015/src/di/metadata.js +2 -2
  17. package/esm2015/src/interface/type.js +2 -2
  18. package/esm2015/src/linker/ng_module_factory.js +3 -5
  19. package/esm2015/src/linker/view_ref.js +3 -6
  20. package/esm2015/src/metadata/directives.js +1 -1
  21. package/esm2015/src/metadata/ng_module.js +1 -1
  22. package/esm2015/src/render3/component_ref.js +4 -13
  23. package/esm2015/src/render3/di.js +12 -4
  24. package/esm2015/src/render3/i18n.js +3 -3
  25. package/esm2015/src/render3/instructions/di.js +1 -1
  26. package/esm2015/src/render3/instructions/listener.js +2 -2
  27. package/esm2015/src/render3/instructions/shared.js +8 -18
  28. package/esm2015/src/render3/node_assert.js +3 -3
  29. package/esm2015/src/render3/node_manipulation.js +11 -7
  30. package/esm2015/src/render3/query.js +2 -2
  31. package/esm2015/src/render3/view_engine_compatibility.js +2 -2
  32. package/esm2015/src/render3/view_ref.js +7 -5
  33. package/esm2015/src/sanitization/html_sanitizer.js +3 -3
  34. package/esm2015/src/sanitization/inert_body.js +39 -82
  35. package/esm2015/src/util/ng_dev_mode.js +2 -2
  36. package/esm2015/src/version.js +1 -1
  37. package/esm2015/testing/src/fake_async_fallback.js +5 -1
  38. package/esm2015/testing/src/r3_test_bed.js +2 -2
  39. package/fesm2015/core.js +118 -159
  40. package/fesm2015/core.js.map +1 -1
  41. package/fesm2015/testing.js +6 -2
  42. package/fesm2015/testing.js.map +1 -1
  43. package/package.json +1 -1
  44. package/schematics/migrations/undecorated-classes-with-decorated-fields/transform.d.ts +7 -0
  45. package/schematics/migrations/undecorated-classes-with-decorated-fields/transform.js +125 -59
  46. package/src/r3_symbols.d.ts +15 -17
  47. package/testing/testing.d.ts +1 -1
  48. package/testing.d.ts +1 -1
  49. package/esm2015/src/util/WrappedValue.js +0 -48
package/core.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v10.0.0
2
+ * @license Angular v10.0.4
3
3
  * (c) 2010-2020 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -166,44 +166,51 @@ export declare interface AfterViewInit {
166
166
  export declare const ANALYZE_FOR_ENTRY_COMPONENTS: InjectionToken<any>;
167
167
 
168
168
  /**
169
- * All callbacks provided via this token will be called for every component that is bootstrapped.
170
- * Signature of the callback:
169
+ * A [DI token](guide/glossary#di-token "DI token definition") that provides a set of callbacks to
170
+ * be called for every component that is bootstrapped.
171
171
  *
172
- * `(componentRef: ComponentRef) => void`.
172
+ * Each callback must take a `ComponentRef` instance and return nothing.
173
+ *
174
+ * `(componentRef: ComponentRef) => void`
173
175
  *
174
176
  * @publicApi
175
177
  */
176
178
  export declare const APP_BOOTSTRAP_LISTENER: InjectionToken<((compRef: ComponentRef<any>) => void)[]>;
177
179
 
178
180
  /**
179
- * A DI Token representing a unique string id assigned to the application by Angular and used
181
+ * A [DI token](guide/glossary#di-token "DI token definition") representing a unique string ID, used
180
182
  * primarily for prefixing application attributes and CSS styles when
181
183
  * {@link ViewEncapsulation#Emulated ViewEncapsulation.Emulated} is being used.
182
184
  *
183
- * If you need to avoid randomly generated value to be used as an application id, you can provide
184
- * a custom value via a DI provider <!-- TODO: provider --> configuring the root {@link Injector}
185
- * using this token.
185
+ * BY default, the value is randomly generated and assigned to the application by Angular.
186
+ * To provide a custom ID value, use a DI provider <!-- TODO: provider --> to configure
187
+ * the root {@link Injector} that uses this token.
188
+ *
186
189
  * @publicApi
187
190
  */
188
191
  export declare const APP_ID: InjectionToken<string>;
189
192
 
190
193
  /**
191
- * An injection token that allows you to provide one or more initialization functions.
192
- * These function are injected at application startup and executed during
194
+ * A [DI token](guide/glossary#di-token "DI token definition") that you can use to provide
195
+ * one or more initialization functions.
196
+ *
197
+ * The provided function are injected at application startup and executed during
193
198
  * app initialization. If any of these functions returns a Promise, initialization
194
199
  * does not complete until the Promise is resolved.
195
200
  *
196
201
  * You can, for example, create a factory function that loads language data
197
202
  * or an external configuration, and provide that function to the `APP_INITIALIZER` token.
198
- * That way, the function is executed during the application bootstrap process,
203
+ * The function is executed during the application bootstrap process,
199
204
  * and the needed data is available on startup.
200
205
  *
206
+ * @see `ApplicationInitStatus`
207
+ *
201
208
  * @publicApi
202
209
  */
203
210
  export declare const APP_INITIALIZER: InjectionToken<(() => void)[]>;
204
211
 
205
212
  /**
206
- * A class that reflects the state of running {@link APP_INITIALIZER}s.
213
+ * A class that reflects the state of running {@link APP_INITIALIZER} functions.
207
214
  *
208
215
  * @publicApi
209
216
  */
@@ -446,11 +453,11 @@ export declare interface AttributeDecorator {
446
453
  * <input type="text">
447
454
  * ```
448
455
  *
449
- * The following example uses the decorator to inject the string literal `text`.
456
+ * The following example uses the decorator to inject the string literal `text` in a directive.
450
457
  *
451
458
  * {@example core/ts/metadata/metadata.ts region='attributeMetadata'}
452
459
  *
453
- * ### Example as TypeScript Decorator
460
+ * The following example uses the decorator in a component constructor.
454
461
  *
455
462
  * {@example core/ts/metadata/metadata.ts region='attributeFactory'}
456
463
  *
@@ -509,6 +516,8 @@ declare interface BootstrapOptions {
509
516
  * The strategy that the default change detector uses to detect changes.
510
517
  * When set, takes effect the next time change detection is triggered.
511
518
  *
519
+ * @see {@link ChangeDetectorRef#usage-notes Change detection usage}
520
+ *
512
521
  * @publicApi
513
522
  */
514
523
  export declare enum ChangeDetectionStrategy {
@@ -527,10 +536,13 @@ export declare enum ChangeDetectionStrategy {
527
536
  }
528
537
 
529
538
  /**
530
- * Base class for Angular Views, provides change detection functionality.
539
+ * Base class that provides change detection functionality.
531
540
  * A change-detection tree collects all views that are to be checked for changes.
532
541
  * Use the methods to add and remove views from the tree, initiate change-detection,
533
- * and explicitly mark views as _dirty_, meaning that they have changed and need to be rerendered.
542
+ * and explicitly mark views as _dirty_, meaning that they have changed and need to be re-rendered.
543
+ *
544
+ * @see [Using change detection hooks](guide/lifecycle-hooks#using-change-detection-hooks)
545
+ * @see [Defining custom change detection](guide/lifecycle-hooks#defining-custom-change-detection)
534
546
  *
535
547
  * @usageNotes
536
548
  *
@@ -888,7 +900,8 @@ export declare interface ComponentDecorator {
888
900
  * An Angular app contains a tree of Angular components.
889
901
  *
890
902
  * Angular components are a subset of directives, always associated with a template.
891
- * Unlike other directives, only one component can be instantiated per an element in a template.
903
+ * Unlike other directives, only one component can be instantiated for a given element in a
904
+ * template.
892
905
  *
893
906
  * A component must belong to an NgModule in order for it to be available
894
907
  * to another component or application. To make it a member of an NgModule,
@@ -1936,10 +1949,10 @@ export declare interface Directive {
1936
1949
  [key: string]: string;
1937
1950
  };
1938
1951
  /**
1939
- * If true, this directive/component will be skipped by the AOT compiler and so will always be
1940
- * compiled using JIT.
1941
- *
1942
- * This exists to support future Ivy work and has no effect currently.
1952
+ * When present, this directive/component is ignored by the AOT compiler.
1953
+ * It remains in distributed code, and the JIT compiler attempts to compile it
1954
+ * at run time, in the browser.
1955
+ * To ensure the correct behavior, the app must import `@angular/compiler`.
1943
1956
  */
1944
1957
  jit?: true;
1945
1958
  }
@@ -2666,7 +2679,7 @@ export declare interface HostBindingDecorator {
2666
2679
  declare type HostBindingsFunction<T> = <U extends T>(rf: ɵRenderFlags, ctx: U) => void;
2667
2680
 
2668
2681
  /**
2669
- * Type of the Host decorator / constructor function.
2682
+ * Type of the `Host` decorator / constructor function.
2670
2683
  *
2671
2684
  * @publicApi
2672
2685
  */
@@ -2676,15 +2689,15 @@ export declare interface HostDecorator {
2676
2689
  * that tells the DI framework to resolve the view by checking injectors of child
2677
2690
  * elements, and stop when reaching the host element of the current component.
2678
2691
  *
2679
- * For an extended example, see
2680
- * ["Dependency Injection Guide"](guide/dependency-injection-in-action#optional).
2681
- *
2682
2692
  * @usageNotes
2683
2693
  *
2684
2694
  * The following shows use with the `@Optional` decorator, and allows for a null result.
2685
2695
  *
2686
2696
  * <code-example path="core/di/ts/metadata_spec.ts" region="Host">
2687
2697
  * </code-example>
2698
+ *
2699
+ * For an extended example, see ["Dependency Injection
2700
+ * Guide"](guide/dependency-injection-in-action#optional).
2688
2701
  */
2689
2702
  (): any;
2690
2703
  new (): Host;
@@ -3028,8 +3041,8 @@ export declare interface Injectable {
3028
3041
  * - 'root' : The application-level injector in most apps.
3029
3042
  * - 'platform' : A special singleton platform injector shared by all
3030
3043
  * applications on the page.
3031
- * - 'any' : Provides a unique instance in every module (including lazy modules) that injects the
3032
- * token.
3044
+ * - 'any' : Provides a unique instance in each lazy loaded module while all eagerly loaded
3045
+ * modules share one instance.
3033
3046
  *
3034
3047
  */
3035
3048
  providedIn?: Type<any> | 'root' | 'platform' | 'any' | null;
@@ -3114,8 +3127,6 @@ export declare interface InjectDecorator {
3114
3127
  * Parameter decorator on a dependency parameter of a class constructor
3115
3128
  * that specifies a custom provider of the dependency.
3116
3129
  *
3117
- * Learn more in the ["Dependency Injection Guide"](guide/dependency-injection).
3118
- *
3119
3130
  * @usageNotes
3120
3131
  * The following example shows a class constructor that specifies a
3121
3132
  * custom provider of a dependency using the parameter decorator.
@@ -3125,6 +3136,9 @@ export declare interface InjectDecorator {
3125
3136
  *
3126
3137
  * <code-example path="core/di/ts/metadata_spec.ts" region="InjectWithoutDecorator">
3127
3138
  * </code-example>
3139
+ *
3140
+ * @see ["Dependency Injection Guide"](guide/dependency-injection)
3141
+ *
3128
3142
  */
3129
3143
  (token: any): any;
3130
3144
  new (token: any): Inject;
@@ -4089,12 +4103,10 @@ export declare class ModuleWithComponentFactories<T> {
4089
4103
  }
4090
4104
 
4091
4105
  /**
4092
- * A wrapper around an NgModule that associates it with the providers.
4093
- *
4094
- * @param T the module type.
4106
+ * A wrapper around an NgModule that associates it with [providers](guide/glossary#provider
4107
+ * "Definition"). Usage without a generic type is deprecated.
4095
4108
  *
4096
- * Note that using ModuleWithProviders without a generic type is deprecated.
4097
- * The generic will become required in a future version of Angular.
4109
+ * @see [Deprecations](guide/deprecations#modulewithproviders-type-without-a-generic)
4098
4110
  *
4099
4111
  * @publicApi
4100
4112
  */
@@ -4306,10 +4318,10 @@ export declare interface NgModule {
4306
4318
  */
4307
4319
  id?: string;
4308
4320
  /**
4309
- * If true, this module will be skipped by the AOT compiler and so will always be compiled
4310
- * using JIT.
4311
- *
4312
- * This exists to support future Ivy work and has no effect currently.
4321
+ * When present, this module is ignored by the AOT compiler.
4322
+ * It remains in distributed code, and the JIT compiler attempts to compile it
4323
+ * at run time, in the browser.
4324
+ * To ensure the correct behavior, the app must import `@angular/compiler`.
4313
4325
  */
4314
4326
  jit?: true;
4315
4327
  }
@@ -4373,25 +4385,23 @@ declare interface NgModuleProviderDef {
4373
4385
  }
4374
4386
 
4375
4387
  /**
4376
- * Represents an instance of an NgModule created via a {@link NgModuleFactory}.
4377
- *
4378
- * `NgModuleRef` provides access to the NgModule Instance as well other objects related to this
4379
- * NgModule Instance.
4388
+ * Represents an instance of an `NgModule` created by an `NgModuleFactory`.
4389
+ * Provides access to the `NgModule` instance and related objects.
4380
4390
  *
4381
4391
  * @publicApi
4382
4392
  */
4383
4393
  export declare abstract class NgModuleRef<T> {
4384
4394
  /**
4385
- * The injector that contains all of the providers of the NgModule.
4395
+ * The injector that contains all of the providers of the `NgModule`.
4386
4396
  */
4387
4397
  abstract get injector(): Injector;
4388
4398
  /**
4389
- * The ComponentFactoryResolver to get hold of the ComponentFactories
4399
+ * The resolver that can retrieve the component factories
4390
4400
  * declared in the `entryComponents` property of the module.
4391
4401
  */
4392
4402
  abstract get componentFactoryResolver(): ComponentFactoryResolver;
4393
4403
  /**
4394
- * The NgModule instance.
4404
+ * The `NgModule` instance.
4395
4405
  */
4396
4406
  abstract get instance(): T;
4397
4407
  /**
@@ -4399,7 +4409,7 @@ export declare abstract class NgModuleRef<T> {
4399
4409
  */
4400
4410
  abstract destroy(): void;
4401
4411
  /**
4402
- * Allows to register a callback that will be called when the module is destroyed.
4412
+ * Registers a callback to be executed when the module is destroyed.
4403
4413
  */
4404
4414
  abstract onDestroy(callback: () => void): void;
4405
4415
  }
@@ -4785,8 +4795,6 @@ export declare interface OptionalDecorator {
4785
4795
  * Can be used together with other parameter decorators
4786
4796
  * that modify how dependency injection operates.
4787
4797
  *
4788
- * Learn more in the ["Dependency Injection Guide"](guide/dependency-injection).
4789
- *
4790
4798
  * @usageNotes
4791
4799
  *
4792
4800
  * The following code allows the possibility of a null result:
@@ -4794,6 +4802,7 @@ export declare interface OptionalDecorator {
4794
4802
  * <code-example path="core/di/ts/metadata_spec.ts" region="Optional">
4795
4803
  * </code-example>
4796
4804
  *
4805
+ * @see ["Dependency Injection Guide"](guide/dependency-injection).
4797
4806
  */
4798
4807
  (): any;
4799
4808
  new (): Optional;
@@ -4856,7 +4865,8 @@ declare const enum OutputType {
4856
4865
  }
4857
4866
 
4858
4867
  /**
4859
- * A token which indicates the root directory of the application
4868
+ * A [DI token](guide/glossary#di-token "DI token definition") that indicates the root directory of
4869
+ * the application
4860
4870
  * @publicApi
4861
4871
  */
4862
4872
  export declare const PACKAGE_ROOT_URL: InjectionToken<string>;
@@ -4979,13 +4989,13 @@ declare type PipeTypeList = (PipeType<any> | Type<any>)[];
4979
4989
  declare type PipeTypesOrFactory = (() => PipeTypeList) | PipeTypeList;
4980
4990
 
4981
4991
  /**
4982
- * A token that indicates an opaque platform id.
4992
+ * A token that indicates an opaque platform ID.
4983
4993
  * @publicApi
4984
4994
  */
4985
4995
  export declare const PLATFORM_ID: InjectionToken<Object>;
4986
4996
 
4987
4997
  /**
4988
- * A function that will be executed when a platform is initialized.
4998
+ * A function that is executed when a platform is initialized.
4989
4999
  * @publicApi
4990
5000
  */
4991
5001
  export declare const PLATFORM_INITIALIZER: InjectionToken<(() => void)[]>;
@@ -6249,7 +6259,6 @@ export declare interface SelfDecorator {
6249
6259
  * <code-example path="core/di/ts/metadata_spec.ts" region="Self">
6250
6260
  * </code-example>
6251
6261
  *
6252
- *
6253
6262
  * @see `SkipSelf`
6254
6263
  * @see `Optional`
6255
6264
  *
@@ -6299,7 +6308,7 @@ export declare interface SimpleChanges {
6299
6308
  }
6300
6309
 
6301
6310
  /**
6302
- * Type of the SkipSelf metadata.
6311
+ * Type of the `SkipSelf` metadata.
6303
6312
  *
6304
6313
  * @publicApi
6305
6314
  */
@@ -6307,7 +6316,7 @@ export declare interface SkipSelf {
6307
6316
  }
6308
6317
 
6309
6318
  /**
6310
- * SkipSelf decorator and metadata.
6319
+ * `SkipSelf` decorator and metadata.
6311
6320
  *
6312
6321
  * @Annotation
6313
6322
  * @publicApi
@@ -6315,7 +6324,7 @@ export declare interface SkipSelf {
6315
6324
  export declare const SkipSelf: SkipSelfDecorator;
6316
6325
 
6317
6326
  /**
6318
- * Type of the SkipSelf decorator / constructor function.
6327
+ * Type of the `SkipSelf` decorator / constructor function.
6319
6328
  *
6320
6329
  * @publicApi
6321
6330
  */
@@ -6334,9 +6343,7 @@ export declare interface SkipSelfDecorator {
6334
6343
  * <code-example path="core/di/ts/metadata_spec.ts" region="SkipSelf">
6335
6344
  * </code-example>
6336
6345
  *
6337
- * Learn more in the
6338
- * [Dependency Injection guide](guide/dependency-injection-in-action#skip).
6339
- *
6346
+ * @see [Dependency Injection guide](guide/dependency-injection-in-action#skip).
6340
6347
  * @see `Self`
6341
6348
  * @see `Optional`
6342
6349
  *
@@ -7814,7 +7821,7 @@ declare const TYPE = 1;
7814
7821
  *
7815
7822
  * Represents a type that a Component or other object is instances of.
7816
7823
  *
7817
- * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is be represented by
7824
+ * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is represented by
7818
7825
  * the `MyCustomComponent` constructor function.
7819
7826
  *
7820
7827
  * @publicApi
@@ -8245,12 +8252,9 @@ declare interface ViewHandleEventFn {
8245
8252
  declare type ViewQueriesFunction<T> = <U extends T>(rf: ɵRenderFlags, ctx: U) => void;
8246
8253
 
8247
8254
  /**
8248
- * Represents an Angular [view](guide/glossary#view),
8249
- * specifically the [host view](guide/glossary#view-tree) that is defined by a component.
8250
- * Also serves as the base class
8251
- * that adds destroy methods for [embedded views](guide/glossary#view-tree).
8255
+ * Represents an Angular [view](guide/glossary#view "Definition").
8252
8256
  *
8253
- * @see `EmbeddedViewRef`
8257
+ * @see {@link ChangeDetectorRef#usage-notes Change detection usage}
8254
8258
  *
8255
8259
  * @publicApi
8256
8260
  */
@@ -9160,7 +9164,7 @@ export declare function ɵangular_packages_core_core_y(tNode: TNode, attrNameToI
9160
9164
  export declare const ɵangular_packages_core_core_z: InstructionState;
9161
9165
 
9162
9166
  /**
9163
- * Providers that will generate a random APP_ID_TOKEN.
9167
+ * Providers that generate a random `APP_ID_TOKEN`.
9164
9168
  * @publicApi
9165
9169
  */
9166
9170
  export declare const ɵAPP_ID_RANDOM_PROVIDER: {