@angular/core 12.1.0-next.4 → 12.1.1

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 (55) hide show
  1. package/bundles/core-testing.umd.js +225 -43
  2. package/bundles/core-testing.umd.js.map +1 -1
  3. package/bundles/core.umd.js +65 -28
  4. package/bundles/core.umd.js.map +1 -1
  5. package/core.d.ts +85 -10
  6. package/core.metadata.json +1 -1
  7. package/esm2015/src/application_ref.js +29 -8
  8. package/esm2015/src/change_detection/differs/iterable_differs.js +1 -1
  9. package/esm2015/src/di/injector_marker.js +1 -1
  10. package/esm2015/src/linker/component_factory_resolver.js +4 -1
  11. package/esm2015/src/linker/element_ref.js +1 -1
  12. package/esm2015/src/linker/query_list.js +2 -1
  13. package/esm2015/src/linker/view_container_ref.js +1 -1
  14. package/esm2015/src/metadata/di.js +1 -1
  15. package/esm2015/src/metadata/do_boostrap.js +1 -1
  16. package/esm2015/src/metadata/ng_module.js +1 -1
  17. package/esm2015/src/metadata/schema.js +5 -1
  18. package/esm2015/src/render3/definition.js +16 -16
  19. package/esm2015/src/render3/node_assert.js +1 -1
  20. package/esm2015/src/util/assert.js +1 -1
  21. package/esm2015/src/util/decorators.js +1 -1
  22. package/esm2015/src/util/dom.js +1 -1
  23. package/esm2015/src/version.js +1 -1
  24. package/esm2015/src/view/util.js +3 -1
  25. package/esm2015/testing/src/r3_test_bed.js +84 -7
  26. package/esm2015/testing/src/test_bed.js +99 -18
  27. package/esm2015/testing/src/test_bed_common.js +7 -1
  28. package/esm2015/testing/src/test_hooks.js +45 -0
  29. package/esm2015/testing/src/testing.js +3 -3
  30. package/fesm2015/core.js +55 -24
  31. package/fesm2015/core.js.map +1 -1
  32. package/fesm2015/testing.js +202 -26
  33. package/fesm2015/testing.js.map +1 -1
  34. package/package.json +2 -2
  35. package/schematics/migrations/can-activate-with-redirect-to/util.js +1 -1
  36. package/schematics/migrations/can-activate-with-redirect-to/util.mjs +1 -1
  37. package/schematics/migrations/initial-navigation/collector.js +3 -2
  38. package/schematics/migrations/initial-navigation/collector.mjs +3 -2
  39. package/schematics/migrations/navigation-extras-omissions/util.js +2 -3
  40. package/schematics/migrations/navigation-extras-omissions/util.mjs +2 -3
  41. package/schematics/migrations/relative-link-resolution/collector.js +3 -2
  42. package/schematics/migrations/relative-link-resolution/collector.mjs +3 -2
  43. package/schematics/migrations/relative-link-resolution/update_recorder.js +1 -1
  44. package/schematics/migrations/relative-link-resolution/update_recorder.mjs +1 -1
  45. package/schematics/migrations/static-queries/strategies/usage_strategy/declaration_usage_visitor.js +2 -2
  46. package/schematics/migrations/static-queries/strategies/usage_strategy/declaration_usage_visitor.mjs +2 -2
  47. package/schematics/migrations/xhr-factory/index.js +1 -1
  48. package/schematics/migrations/xhr-factory/index.mjs +1 -1
  49. package/schematics/utils/typescript/imports.js +2 -2
  50. package/schematics/utils/typescript/imports.mjs +2 -2
  51. package/src/r3_symbols.d.ts +4 -1
  52. package/testing/testing.d.ts +63 -5
  53. package/testing/testing.metadata.json +1 -1
  54. package/testing.d.ts +1 -1
  55. package/esm2015/testing/src/before_each.js +0 -33
package/core.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v12.1.0-next.4
2
+ * @license Angular v12.1.1
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -411,20 +411,41 @@ export declare class ApplicationRef {
411
411
  */
412
412
  readonly isStable: Observable<boolean>;
413
413
  /**
414
- * Bootstrap a new component at the root level of the application.
414
+ * Bootstrap a component onto the element identified by its selector or, optionally, to a
415
+ * specified element.
415
416
  *
416
417
  * @usageNotes
417
418
  * ### Bootstrap process
418
419
  *
419
- * When bootstrapping a new root component into an application, Angular mounts the
420
- * specified application component onto DOM elements identified by the componentType's
421
- * selector and kicks off automatic change detection to finish initializing the component.
420
+ * When bootstrapping a component, Angular mounts it onto a target DOM element
421
+ * and kicks off automatic change detection. The target DOM element can be
422
+ * provided using the `rootSelectorOrNode` argument.
422
423
  *
423
- * Optionally, a component can be mounted onto a DOM element that does not match the
424
- * componentType's selector.
424
+ * If the target DOM element is not provided, Angular tries to find one on a page
425
+ * using the `selector` of the component that is being bootstrapped
426
+ * (first matched element is used).
425
427
  *
426
428
  * ### Example
427
- * {@example core/ts/platform/platform.ts region='longform'}
429
+ *
430
+ * Generally, we define the component to bootstrap in the `bootstrap` array of `NgModule`,
431
+ * but it requires us to know the component while writing the application code.
432
+ *
433
+ * Imagine a situation where we have to wait for an API call to decide about the component to
434
+ * bootstrap. We can use the `ngDoBootstrap` hook of the `NgModule` and call this method to
435
+ * dynamically bootstrap a component.
436
+ *
437
+ * {@example core/ts/platform/platform.ts region='componentSelector'}
438
+ *
439
+ * Optionally, a component can be mounted onto a DOM element that does not match the
440
+ * selector of the bootstrapped component.
441
+ *
442
+ * In the following example, we are providing a CSS selector to match the target element.
443
+ *
444
+ * {@example core/ts/platform/platform.ts region='cssSelector'}
445
+ *
446
+ * While in this example, we are providing reference to a DOM node.
447
+ *
448
+ * {@example core/ts/platform/platform.ts region='domNode'}
428
449
  */
429
450
  bootstrap<C>(componentOrFactory: ComponentFactory<C> | Type<C>, rootSelectorOrNode?: string | any): ComponentRef<C>;
430
451
  /**
@@ -1153,6 +1174,9 @@ export { ComponentFactory as ɵComponentFactory }
1153
1174
  * then use the factory's `create()` method to create a component of that type.
1154
1175
  *
1155
1176
  * @see [Dynamic Components](guide/dynamic-component-loader)
1177
+ * @see [Usage Example](guide/dynamic-component-loader#resolving-components)
1178
+ * @see <live-example name="dynamic-component-loader" noDownload></live-example>
1179
+ of the code in this cookbook
1156
1180
  * @publicApi
1157
1181
  */
1158
1182
  export declare abstract class ComponentFactoryResolver {
@@ -1318,6 +1342,17 @@ export declare interface ContentChildDecorator {
1318
1342
  * * **static** - True to resolve query results before change detection runs,
1319
1343
  * false to resolve after change detection. Defaults to false.
1320
1344
  *
1345
+ * The following selectors are supported.
1346
+ * * Any class with the `@Component` or `@Directive` decorator
1347
+ * * A template reference variable as a string (e.g. query `<my-component #cmp></my-component>`
1348
+ * with `@ContentChild('cmp')`)
1349
+ * * Any provider defined in the child component tree of the current component (e.g.
1350
+ * `@ContentChild(SomeService) someService: SomeService`)
1351
+ * * Any provider defined through a string token (e.g. `@ContentChild('someToken') someTokenVal:
1352
+ * any`)
1353
+ * * A `TemplateRef` (e.g. query `<ng-template></ng-template>` with `@ContentChild(TemplateRef)
1354
+ * template;`)
1355
+ *
1321
1356
  * The following values are supported by `read`:
1322
1357
  * * Any class with the `@Component` or `@Directive` decorator
1323
1358
  * * Any provider defined on the injector of the component that is matched by the `selector` of
@@ -1394,6 +1429,20 @@ export declare interface ContentChildrenDecorator {
1394
1429
  * removed in future versions of Angular.
1395
1430
  * * **read** - Used to read a different token from the queried elements.
1396
1431
  *
1432
+ * The following selectors are supported.
1433
+ * * Any class with the `@Component` or `@Directive` decorator
1434
+ * * A template reference variable as a string (e.g. query `<my-component #cmp></my-component>`
1435
+ * with `@ContentChildren('cmp')`)
1436
+ * * Any provider defined in the child component tree of the current component (e.g.
1437
+ * `@ContentChildren(SomeService) someService: SomeService`)
1438
+ * * Any provider defined through a string token (e.g. `@ContentChildren('someToken')
1439
+ * someTokenVal: any`)
1440
+ * * A `TemplateRef` (e.g. query `<ng-template></ng-template>` with
1441
+ * `@ContentChildren(TemplateRef) template;`)
1442
+ *
1443
+ * In addition, multiple string selectors can be separated with a comma (e.g.
1444
+ * `@ContentChildren('cmp1,cmp2')`)
1445
+ *
1397
1446
  * The following values are supported by `read`:
1398
1447
  * * Any class with the `@Component` or `@Directive` decorator
1399
1448
  * * Any provider defined on the injector of the component that is matched by the `selector` of
@@ -2287,6 +2336,9 @@ declare interface DisposableFn {
2287
2336
  * See ["Bootstrapping"](guide/bootstrapping) and ["Entry components"](guide/entry-components).
2288
2337
  *
2289
2338
  * @usageNotes
2339
+ * The example below uses `ApplicationRef.bootstrap()` to render the
2340
+ * `AppComponent` on the page.
2341
+ *
2290
2342
  * ```typescript
2291
2343
  * class AppModule implements DoBootstrap {
2292
2344
  * ngDoBootstrap(appRef: ApplicationRef) {
@@ -4630,7 +4682,10 @@ export declare interface NgModule {
4630
4682
  * using one of the imperative techniques, such as `ViewContainerRef.createComponent()`.
4631
4683
  *
4632
4684
  * @see [Entry Components](guide/entry-components)
4633
- * @deprecated Since 9.0.0. With Ivy, this property is no longer necessary.
4685
+ * @deprecated
4686
+ * Since 9.0.0. With Ivy, this property is no longer necessary.
4687
+ * (You may need to keep these if building a library that will be consumed by a View Engine
4688
+ * application.)
4634
4689
  */
4635
4690
  entryComponents?: Array<Type<any> | any[]>;
4636
4691
  /**
@@ -4923,6 +4978,10 @@ export declare class NgZone {
4923
4978
  /**
4924
4979
  * Defines a schema that allows any property on any element.
4925
4980
  *
4981
+ * This schema allows you to ignore the errors related to any unknown elements or properties in a
4982
+ * template. The usage of this schema is generally discouraged because it prevents useful validation
4983
+ * and may hide real errors in your template. Consider using the `CUSTOM_ELEMENTS_SCHEMA` instead.
4984
+ *
4926
4985
  * @publicApi
4927
4986
  */
4928
4987
  export declare const NO_ERRORS_SCHEMA: SchemaMetadata;
@@ -8008,7 +8067,7 @@ export declare interface TrackByFunction<T> {
8008
8067
  * @param index The index of the item within the iterable.
8009
8068
  * @param item The item in the iterable.
8010
8069
  */
8011
- (index: number, item: T): any;
8070
+ <U extends T>(index: number, item: U): any;
8012
8071
  }
8013
8072
 
8014
8073
  /**
@@ -8720,6 +8779,20 @@ export declare interface ViewChildrenDecorator {
8720
8779
  * ** Note: *** This config option is **deprecated**, it will be permanently set to `true` and
8721
8780
  * removed in future versions of Angular.
8722
8781
  *
8782
+ * The following selectors are supported.
8783
+ * * Any class with the `@Component` or `@Directive` decorator
8784
+ * * A template reference variable as a string (e.g. query `<my-component #cmp></my-component>`
8785
+ * with `@ViewChildren('cmp')`)
8786
+ * * Any provider defined in the child component tree of the current component (e.g.
8787
+ * `@ViewChildren(SomeService) someService: SomeService`)
8788
+ * * Any provider defined through a string token (e.g. `@ViewChildren('someToken') someTokenVal:
8789
+ * any`)
8790
+ * * A `TemplateRef` (e.g. query `<ng-template></ng-template>` with `@ViewChildren(TemplateRef)
8791
+ * template;`)
8792
+ *
8793
+ * In addition, multiple string selectors can be separated with a comma (e.g.
8794
+ * `@ViewChildren('cmp1,cmp2')`)
8795
+ *
8723
8796
  * The following values are supported by `read`:
8724
8797
  * * Any class with the `@Component` or `@Directive` decorator
8725
8798
  * * Any provider defined on the injector of the component that is matched by the `selector` of
@@ -8802,6 +8875,8 @@ export declare abstract class ViewContainerRef {
8802
8875
  * Instantiates an embedded view and inserts it
8803
8876
  * into this container.
8804
8877
  * @param templateRef The HTML template that defines the view.
8878
+ * @param context The data-binding context of the embedded view, as declared
8879
+ * in the `<ng-template>` usage.
8805
8880
  * @param index The 0-based index at which to insert the new view into this container.
8806
8881
  * If not specified, appends the new view as the last entry.
8807
8882
  *