@angular/core 14.0.0-rc.1 → 14.0.0-rc.2

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.0.0-rc.1
2
+ * @license Angular v14.0.0-rc.2
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -2315,21 +2315,53 @@ export declare interface DirectiveDecorator {
2315
2315
  *
2316
2316
  * ### Declaring directives
2317
2317
  *
2318
- * Directives are [declarables](guide/glossary#declarable).
2319
- * They must be declared by an NgModule
2320
- * in order to be usable in an app.
2318
+ * In order to make a directive available to other components in your application, you should do
2319
+ * one of the following:
2320
+ * - either mark the directive as [standalone](guide/standalone-components),
2321
+ * - or declare it in an NgModule by adding it to the `declarations` and `exports` fields.
2321
2322
  *
2322
- * A directive must belong to exactly one NgModule. Do not re-declare
2323
- * a directive imported from another module.
2324
- * List the directive class in the `declarations` field of an NgModule.
2323
+ * ** Marking a directive as standalone **
2324
+ *
2325
+ * You can add the `standalone: true` flag to the Directive decorator metadata to declare it as
2326
+ * [standalone](guide/standalone-components):
2325
2327
  *
2326
2328
  * ```ts
2327
- * declarations: [
2328
- * AppComponent,
2329
- * MyDirective
2330
- * ],
2329
+ * @Directive({
2330
+ * standalone: true,
2331
+ * selector: 'my-directive',
2332
+ * })
2333
+ * class MyDirective {}
2331
2334
  * ```
2332
2335
  *
2336
+ * When marking a directive as standalone, please make sure that the directive is not already
2337
+ * declared in an NgModule.
2338
+ *
2339
+ *
2340
+ * ** Declaring a directive in an NgModule **
2341
+ *
2342
+ * Another approach is to declare a directive in an NgModule:
2343
+ *
2344
+ * ```ts
2345
+ * @Directive({
2346
+ * selector: 'my-directive',
2347
+ * })
2348
+ * class MyDirective {}
2349
+ *
2350
+ * @NgModule({
2351
+ * declarations: [MyDirective, SomeComponent],
2352
+ * exports: [MyDirective], // making it available outside of this module
2353
+ * })
2354
+ * class SomeNgModule {}
2355
+ * ```
2356
+ *
2357
+ * When declaring a directive in an NgModule, please make sure that:
2358
+ * - the directive is declared in exactly one NgModule.
2359
+ * - the directive is not standalone.
2360
+ * - you do not re-declare a directive imported from another module.
2361
+ * - the directive is included into the `exports` field as well if you want this directive to be
2362
+ * accessible for components outside of the NgModule.
2363
+ *
2364
+ *
2333
2365
  * @Annotation
2334
2366
  */
2335
2367
  (obj?: Directive): TypeDecorator;
@@ -3611,7 +3643,7 @@ export declare type InjectableProvider = ValueSansProvider | ExistingSansProvide
3611
3643
  * A `Type` which has a `ɵprov: ɵɵInjectableDeclaration` static field.
3612
3644
  *
3613
3645
  * `InjectableType`s contain their own Dependency Injection metadata and are usable in an
3614
- * `InjectorDef`-based `StaticInjector.
3646
+ * `InjectorDef`-based `StaticInjector`.
3615
3647
  *
3616
3648
  * @publicApi
3617
3649
  */
@@ -9693,7 +9725,8 @@ export declare interface ɵComponentDef<T> extends ɵDirectiveDef<T> {
9693
9725
  */
9694
9726
  tView: TView | null;
9695
9727
  /**
9696
- * A function added by the {@see ɵɵStandaloneFeature} and used by the framework to create standalone injectors.
9728
+ * A function added by the {@link ɵɵStandaloneFeature} and used by the framework to create
9729
+ * standalone injectors.
9697
9730
  */
9698
9731
  getStandaloneInjector: ((parentInjector: EnvironmentInjector) => EnvironmentInjector | null) | null;
9699
9732
  /**
@@ -13777,7 +13810,7 @@ export declare function ɵɵsetNgModuleScope(type: any, scope: {
13777
13810
  }): unknown;
13778
13811
 
13779
13812
  /**
13780
- * A feature that acts as a setup code for the {@see StandaloneService}.
13813
+ * A feature that acts as a setup code for the {@link StandaloneService}.
13781
13814
  *
13782
13815
  * The most important responsaibility of this feature is to expose the "getStandaloneInjector"
13783
13816
  * function (an entry points to a standalone injector creation) on a component definition object. We
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "14.0.0-rc.1",
3
+ "version": "14.0.0-rc.2",
4
4
  "description": "Angular - the core framework",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.0.0-rc.1
2
+ * @license Angular v14.0.0-rc.2
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */