@angular/core 19.0.2 → 19.0.3
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/fesm2022/core.mjs +91 -93
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +8 -8
- package/fesm2022/testing.mjs.map +1 -1
- package/index.d.ts +95 -102
- package/package.json +1 -1
- package/primitives/event-dispatch/index.d.ts +1 -1
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/bundles/{checker-a00b735e.js → checker-c58f97d2.js} +30 -30
- package/schematics/bundles/{combine_units-60865867.js → combine_units-605024c1.js} +3 -3
- package/schematics/bundles/{compiler_host-3e96c3f7.js → compiler_host-f5d588fe.js} +2 -2
- package/schematics/bundles/control-flow-migration.js +3 -3
- package/schematics/bundles/explicit-standalone-flag.js +4 -4
- package/schematics/bundles/{imports-44987700.js → imports-31a38653.js} +2 -2
- package/schematics/bundles/inject-migration.js +9 -9
- package/schematics/bundles/leading_space-6e7a8ec6.js +1 -1
- package/schematics/bundles/{migrate_ts_type_references-676612f5.js → migrate_ts_type_references-596627c6.js} +8 -8
- package/schematics/bundles/{nodes-b12e919a.js → nodes-88c2157f.js} +2 -2
- package/schematics/bundles/output-migration.js +4 -4
- package/schematics/bundles/pending-tasks.js +4 -4
- package/schematics/bundles/{program-a6be5d4a.js → program-fe7d9b66.js} +12 -12
- package/schematics/bundles/project_tsconfig_paths-6c9cde78.js +1 -1
- package/schematics/bundles/provide-initializer.js +4 -4
- package/schematics/bundles/route-lazy-loading.js +3 -3
- package/schematics/bundles/signal-input-migration.js +6 -6
- package/schematics/bundles/signal-queries-migration.js +5 -5
- package/schematics/bundles/signals.js +5 -5
- package/schematics/bundles/standalone-migration.js +7 -7
- package/testing/index.d.ts +5 -5
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v19.0.
|
|
2
|
+
* @license Angular v19.0.3
|
|
3
3
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -141,7 +141,7 @@ export declare interface AfterContentInit {
|
|
|
141
141
|
* for example to initialize a non-Angular library.
|
|
142
142
|
*
|
|
143
143
|
* ### Example
|
|
144
|
-
* ```ts
|
|
144
|
+
* ```angular-ts
|
|
145
145
|
* @Component({
|
|
146
146
|
* selector: 'my-chart-cmp',
|
|
147
147
|
* template: `<div #chart>{{ ... }}</div>`,
|
|
@@ -201,7 +201,7 @@ export declare function afterNextRender<E = never, W = never, M = never>(spec: {
|
|
|
201
201
|
* for example to initialize a non-Angular library.
|
|
202
202
|
*
|
|
203
203
|
* ### Example
|
|
204
|
-
* ```ts
|
|
204
|
+
* ```angular-ts
|
|
205
205
|
* @Component({
|
|
206
206
|
* selector: 'my-chart-cmp',
|
|
207
207
|
* template: `<div #chart>{{ ... }}</div>`,
|
|
@@ -281,7 +281,7 @@ export declare function afterNextRender(callback: VoidFunction, options?: AfterR
|
|
|
281
281
|
* Use `afterRender` to read or write the DOM after each render.
|
|
282
282
|
*
|
|
283
283
|
* ### Example
|
|
284
|
-
* ```ts
|
|
284
|
+
* ```angular-ts
|
|
285
285
|
* @Component({
|
|
286
286
|
* selector: 'my-cmp',
|
|
287
287
|
* template: `<span #content>{{ ... }}</span>`,
|
|
@@ -340,7 +340,7 @@ export declare function afterRender<E = never, W = never, M = never>(spec: {
|
|
|
340
340
|
* Use `afterRender` to read or write the DOM after each render.
|
|
341
341
|
*
|
|
342
342
|
* ### Example
|
|
343
|
-
* ```ts
|
|
343
|
+
* ```angular-ts
|
|
344
344
|
* @Component({
|
|
345
345
|
* selector: 'my-cmp',
|
|
346
346
|
* template: `<span #content>{{ ... }}</span>`,
|
|
@@ -704,7 +704,7 @@ export declare const APP_BOOTSTRAP_LISTENER: InjectionToken<readonly ((compRef:
|
|
|
704
704
|
* (for example, using `bootstrapApplication` calls). In this case, ensure that those applications
|
|
705
705
|
* have different `APP_ID` value setup. For example:
|
|
706
706
|
*
|
|
707
|
-
* ```
|
|
707
|
+
* ```ts
|
|
708
708
|
* bootstrapApplication(ComponentA, {
|
|
709
709
|
* providers: [
|
|
710
710
|
* { provide: APP_ID, useValue: 'app-a' },
|
|
@@ -752,7 +752,7 @@ export declare const APP_ID: InjectionToken<string>;
|
|
|
752
752
|
* The following example illustrates how to configure a multi-provider using `APP_INITIALIZER` token
|
|
753
753
|
* and a function returning a promise.
|
|
754
754
|
* ### Example with NgModule-based application
|
|
755
|
-
* ```
|
|
755
|
+
* ```ts
|
|
756
756
|
* function initializeApp(): Promise<any> {
|
|
757
757
|
* const http = inject(HttpClient);
|
|
758
758
|
* return firstValueFrom(
|
|
@@ -776,7 +776,7 @@ export declare const APP_ID: InjectionToken<string>;
|
|
|
776
776
|
* ```
|
|
777
777
|
*
|
|
778
778
|
* ### Example with standalone application
|
|
779
|
-
* ```
|
|
779
|
+
* ```ts
|
|
780
780
|
* function initializeApp() {
|
|
781
781
|
* const http = inject(HttpClient);
|
|
782
782
|
* return firstValueFrom(
|
|
@@ -806,7 +806,7 @@ export declare const APP_ID: InjectionToken<string>;
|
|
|
806
806
|
* through DI.
|
|
807
807
|
*
|
|
808
808
|
* ### Example with NgModule-based application
|
|
809
|
-
* ```
|
|
809
|
+
* ```ts
|
|
810
810
|
* function initializeApp() {
|
|
811
811
|
* const http = inject(HttpClient);
|
|
812
812
|
* return firstValueFrom(
|
|
@@ -830,7 +830,7 @@ export declare const APP_ID: InjectionToken<string>;
|
|
|
830
830
|
* ```
|
|
831
831
|
*
|
|
832
832
|
* ### Example with standalone application
|
|
833
|
-
* ```
|
|
833
|
+
* ```ts
|
|
834
834
|
* function initializeApp() {
|
|
835
835
|
* const http = inject(HttpClient);
|
|
836
836
|
* return firstValueFrom(
|
|
@@ -918,7 +918,7 @@ export declare class ApplicationModule {
|
|
|
918
918
|
* (here incrementing a counter, using RxJS `interval`),
|
|
919
919
|
* and at the same time subscribe to `isStable`.
|
|
920
920
|
*
|
|
921
|
-
* ```
|
|
921
|
+
* ```ts
|
|
922
922
|
* constructor(appRef: ApplicationRef) {
|
|
923
923
|
* appRef.isStable.pipe(
|
|
924
924
|
* filter(stable => stable)
|
|
@@ -933,7 +933,7 @@ export declare class ApplicationModule {
|
|
|
933
933
|
* you have to wait for the application to be stable
|
|
934
934
|
* before starting your polling process.
|
|
935
935
|
*
|
|
936
|
-
* ```
|
|
936
|
+
* ```ts
|
|
937
937
|
* constructor(appRef: ApplicationRef) {
|
|
938
938
|
* appRef.isStable.pipe(
|
|
939
939
|
* first(stable => stable),
|
|
@@ -953,7 +953,7 @@ export declare class ApplicationModule {
|
|
|
953
953
|
* you update a field of your component
|
|
954
954
|
* and display it in its template.
|
|
955
955
|
*
|
|
956
|
-
* ```
|
|
956
|
+
* ```ts
|
|
957
957
|
* constructor(appRef: ApplicationRef) {
|
|
958
958
|
* appRef.isStable.pipe(
|
|
959
959
|
* first(stable => stable),
|
|
@@ -967,7 +967,7 @@ export declare class ApplicationModule {
|
|
|
967
967
|
*
|
|
968
968
|
* You'll have to manually trigger the change detection to update the template.
|
|
969
969
|
*
|
|
970
|
-
* ```
|
|
970
|
+
* ```ts
|
|
971
971
|
* constructor(appRef: ApplicationRef, cd: ChangeDetectorRef) {
|
|
972
972
|
* appRef.isStable.pipe(
|
|
973
973
|
* first(stable => stable),
|
|
@@ -981,7 +981,7 @@ export declare class ApplicationModule {
|
|
|
981
981
|
*
|
|
982
982
|
* Or make the subscription callback run inside the zone.
|
|
983
983
|
*
|
|
984
|
-
* ```
|
|
984
|
+
* ```ts
|
|
985
985
|
* constructor(appRef: ApplicationRef, zone: NgZone) {
|
|
986
986
|
* appRef.isStable.pipe(
|
|
987
987
|
* first(stable => stable),
|
|
@@ -1277,7 +1277,7 @@ export declare interface AttributeDecorator {
|
|
|
1277
1277
|
* Intended to be used as a transform function of an input.
|
|
1278
1278
|
*
|
|
1279
1279
|
* @usageNotes
|
|
1280
|
-
* ```
|
|
1280
|
+
* ```ts
|
|
1281
1281
|
* @Input({ transform: booleanAttribute }) status!: boolean;
|
|
1282
1282
|
* ```
|
|
1283
1283
|
* @param value Value to be transformed.
|
|
@@ -1408,8 +1408,7 @@ declare type ChangeDetectionStrategy_2 = number;
|
|
|
1408
1408
|
* (`CheckOnce`, rather than the default `CheckAlways`), then forces a second check
|
|
1409
1409
|
* after an interval.
|
|
1410
1410
|
*
|
|
1411
|
-
*
|
|
1412
|
-
* region="mark-for-check"></code-example>
|
|
1411
|
+
* {@example core/ts/change_detect/change-detection.ts region='mark-for-check'}
|
|
1413
1412
|
*
|
|
1414
1413
|
* ### Detach change detector to limit how often check occurs
|
|
1415
1414
|
*
|
|
@@ -1419,7 +1418,7 @@ declare type ChangeDetectionStrategy_2 = number;
|
|
|
1419
1418
|
* less often than the changes actually occur. To do that, we detach
|
|
1420
1419
|
* the component's change detector and perform an explicit local check every five seconds.
|
|
1421
1420
|
*
|
|
1422
|
-
*
|
|
1421
|
+
* {@example core/ts/change_detect/change-detection.ts region='detach'}
|
|
1423
1422
|
*
|
|
1424
1423
|
*
|
|
1425
1424
|
* ### Reattaching a detached component
|
|
@@ -1429,7 +1428,7 @@ declare type ChangeDetectionStrategy_2 = number;
|
|
|
1429
1428
|
* when the `live` property is set to false, and reattaches it when the property
|
|
1430
1429
|
* becomes true.
|
|
1431
1430
|
*
|
|
1432
|
-
*
|
|
1431
|
+
* {@example core/ts/change_detect/change-detection.ts region='reattach'}
|
|
1433
1432
|
*
|
|
1434
1433
|
* @publicApi
|
|
1435
1434
|
*/
|
|
@@ -1799,7 +1798,7 @@ export declare interface ComponentDecorator {
|
|
|
1799
1798
|
* The following example creates a component with two data-bound properties,
|
|
1800
1799
|
* specified by the `inputs` value.
|
|
1801
1800
|
*
|
|
1802
|
-
*
|
|
1801
|
+
* {@example core/ts/metadata/directives.ts region='component-input'}
|
|
1803
1802
|
*
|
|
1804
1803
|
*
|
|
1805
1804
|
* ### Setting component outputs
|
|
@@ -2556,7 +2555,7 @@ declare const CONTEXT = 8;
|
|
|
2556
2555
|
* Note: the example uses standalone components, but the function can also be used for
|
|
2557
2556
|
* non-standalone components (declared in an NgModule) as well.
|
|
2558
2557
|
*
|
|
2559
|
-
* ```
|
|
2558
|
+
* ```angular-ts
|
|
2560
2559
|
* @Component({
|
|
2561
2560
|
* standalone: true,
|
|
2562
2561
|
* template: `Hello {{ name }}!`
|
|
@@ -2996,7 +2995,7 @@ declare const DECLARATION_VIEW = 14;
|
|
|
2996
2995
|
* @usageNotes
|
|
2997
2996
|
* ### Example
|
|
2998
2997
|
*
|
|
2999
|
-
* ```
|
|
2998
|
+
* ```ts
|
|
3000
2999
|
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
3001
3000
|
* import { AppModule } from './app/app.module';
|
|
3002
3001
|
*
|
|
@@ -3342,7 +3341,7 @@ export declare abstract class DestroyRef {
|
|
|
3342
3341
|
*
|
|
3343
3342
|
* @usageNotes
|
|
3344
3343
|
* ### Example
|
|
3345
|
-
* ```
|
|
3344
|
+
* ```ts
|
|
3346
3345
|
* const destroyRef = inject(DestroyRef);
|
|
3347
3346
|
*
|
|
3348
3347
|
* // register a destroy callback
|
|
@@ -3412,7 +3411,7 @@ export declare interface Directive {
|
|
|
3412
3411
|
*
|
|
3413
3412
|
* The following example creates a component with two data-bound properties.
|
|
3414
3413
|
*
|
|
3415
|
-
* ```
|
|
3414
|
+
* ```ts
|
|
3416
3415
|
* @Component({
|
|
3417
3416
|
* selector: 'bank-account',
|
|
3418
3417
|
* inputs: ['bankName', {name: 'id', alias: 'account-id'}],
|
|
@@ -3448,7 +3447,7 @@ export declare interface Directive {
|
|
|
3448
3447
|
*
|
|
3449
3448
|
* @usageNotes
|
|
3450
3449
|
*
|
|
3451
|
-
* ```
|
|
3450
|
+
* ```ts
|
|
3452
3451
|
* @Component({
|
|
3453
3452
|
* selector: 'child-dir',
|
|
3454
3453
|
* outputs: [ 'bankNameChange' ],
|
|
@@ -3832,7 +3831,7 @@ declare type DirectiveDefListOrFactory = (() => DirectiveDefList) | DirectiveDef
|
|
|
3832
3831
|
* Map of inputs for a given directive/component.
|
|
3833
3832
|
*
|
|
3834
3833
|
* Given:
|
|
3835
|
-
* ```
|
|
3834
|
+
* ```ts
|
|
3836
3835
|
* class MyComponent {
|
|
3837
3836
|
* @Input()
|
|
3838
3837
|
* publicInput1: string;
|
|
@@ -3848,7 +3847,7 @@ declare type DirectiveDefListOrFactory = (() => DirectiveDefList) | DirectiveDef
|
|
|
3848
3847
|
* ```
|
|
3849
3848
|
*
|
|
3850
3849
|
* is described as:
|
|
3851
|
-
* ```
|
|
3850
|
+
* ```ts
|
|
3852
3851
|
* {
|
|
3853
3852
|
* publicInput1: 'publicInput1',
|
|
3854
3853
|
* declaredInput2: [InputFlags.None, 'declaredInput2', 'publicInput2'],
|
|
@@ -3863,7 +3862,7 @@ declare type DirectiveDefListOrFactory = (() => DirectiveDefList) | DirectiveDef
|
|
|
3863
3862
|
* ```
|
|
3864
3863
|
*
|
|
3865
3864
|
* Which the minifier may translate to:
|
|
3866
|
-
* ```
|
|
3865
|
+
* ```ts
|
|
3867
3866
|
* {
|
|
3868
3867
|
* minifiedPublicInput1: 'publicInput1',
|
|
3869
3868
|
* minifiedDeclaredInput2: [InputFlags.None, 'publicInput2', 'declaredInput2'],
|
|
@@ -3910,7 +3909,7 @@ declare const DISCONNECTED_NODES = "d";
|
|
|
3910
3909
|
* The example below uses `ApplicationRef.bootstrap()` to render the
|
|
3911
3910
|
* `AppComponent` on the page.
|
|
3912
3911
|
*
|
|
3913
|
-
* ```
|
|
3912
|
+
* ```ts
|
|
3914
3913
|
* class AppModule implements DoBootstrap {
|
|
3915
3914
|
* ngDoBootstrap(appRef: ApplicationRef) {
|
|
3916
3915
|
* appRef.bootstrap(AppComponent); // Or some other component
|
|
@@ -4089,7 +4088,7 @@ declare const EMBEDDED_VIEW_INJECTOR = 20;
|
|
|
4089
4088
|
* The following template breaks down into two separate `TemplateRef` instances,
|
|
4090
4089
|
* an outer one and an inner one.
|
|
4091
4090
|
*
|
|
4092
|
-
* ```
|
|
4091
|
+
* ```html
|
|
4093
4092
|
* Count: {{items.length}}
|
|
4094
4093
|
* <ul>
|
|
4095
4094
|
* <li *ngFor="let item of items">{{item}}</li>
|
|
@@ -4098,7 +4097,7 @@ declare const EMBEDDED_VIEW_INJECTOR = 20;
|
|
|
4098
4097
|
*
|
|
4099
4098
|
* This is the outer `TemplateRef`:
|
|
4100
4099
|
*
|
|
4101
|
-
* ```
|
|
4100
|
+
* ```html
|
|
4102
4101
|
* Count: {{items.length}}
|
|
4103
4102
|
* <ul>
|
|
4104
4103
|
* <ng-template ngFor let-item [ngForOf]="items"></ng-template>
|
|
@@ -4107,13 +4106,13 @@ declare const EMBEDDED_VIEW_INJECTOR = 20;
|
|
|
4107
4106
|
*
|
|
4108
4107
|
* This is the inner `TemplateRef`:
|
|
4109
4108
|
*
|
|
4110
|
-
* ```
|
|
4109
|
+
* ```html
|
|
4111
4110
|
* <li>{{item}}</li>
|
|
4112
4111
|
* ```
|
|
4113
4112
|
*
|
|
4114
4113
|
* The outer and inner `TemplateRef` instances are assembled into views as follows:
|
|
4115
4114
|
*
|
|
4116
|
-
* ```
|
|
4115
|
+
* ```html
|
|
4117
4116
|
* <!-- ViewRef: outer-0 -->
|
|
4118
4117
|
* Count: 2
|
|
4119
4118
|
* <ul>
|
|
@@ -4250,7 +4249,7 @@ export declare type EnvironmentProviders = {
|
|
|
4250
4249
|
* @usageNotes
|
|
4251
4250
|
* ### Example
|
|
4252
4251
|
*
|
|
4253
|
-
* ```
|
|
4252
|
+
* ```ts
|
|
4254
4253
|
* class MyErrorHandler implements ErrorHandler {
|
|
4255
4254
|
* handleError(error) {
|
|
4256
4255
|
* // do something with the exception
|
|
@@ -4294,7 +4293,7 @@ declare interface EventContractDetails {
|
|
|
4294
4293
|
* that create event emitters. When the title is clicked, the emitter
|
|
4295
4294
|
* emits an open or close event to toggle the current visibility state.
|
|
4296
4295
|
*
|
|
4297
|
-
* ```
|
|
4296
|
+
* ```angular-ts
|
|
4298
4297
|
* @Component({
|
|
4299
4298
|
* selector: 'zippy',
|
|
4300
4299
|
* template: `
|
|
@@ -4497,7 +4496,7 @@ declare const FLAGS = 2;
|
|
|
4497
4496
|
* {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref'}
|
|
4498
4497
|
*
|
|
4499
4498
|
* ### Circular standalone reference import example
|
|
4500
|
-
* ```ts
|
|
4499
|
+
* ```angular-ts
|
|
4501
4500
|
* @Component({
|
|
4502
4501
|
* standalone: true,
|
|
4503
4502
|
* imports: [ChildComponent],
|
|
@@ -4842,7 +4841,7 @@ export declare const Host: HostDecorator;
|
|
|
4842
4841
|
*
|
|
4843
4842
|
* @usageNotes
|
|
4844
4843
|
* ### Injecting a tag name that is known to exist
|
|
4845
|
-
* ```
|
|
4844
|
+
* ```ts
|
|
4846
4845
|
* @Directive()
|
|
4847
4846
|
* class MyDir {
|
|
4848
4847
|
* tagName: string = inject(HOST_TAG_NAME);
|
|
@@ -4850,7 +4849,7 @@ export declare const Host: HostDecorator;
|
|
|
4850
4849
|
* ```
|
|
4851
4850
|
*
|
|
4852
4851
|
* ### Optionally injecting a tag name
|
|
4853
|
-
* ```
|
|
4852
|
+
* ```ts
|
|
4854
4853
|
* @Directive()
|
|
4855
4854
|
* class MyDir {
|
|
4856
4855
|
* tagName: string | null = inject(HOST_TAG_NAME, {optional: true});
|
|
@@ -4865,7 +4864,7 @@ export declare const HOST_TAG_NAME: InjectionToken<string>;
|
|
|
4865
4864
|
*
|
|
4866
4865
|
* @usageNotes
|
|
4867
4866
|
* ### Injecting an attribute that is known to exist
|
|
4868
|
-
* ```
|
|
4867
|
+
* ```ts
|
|
4869
4868
|
* @Directive()
|
|
4870
4869
|
* class MyDir {
|
|
4871
4870
|
* attr: string = inject(new HostAttributeToken('some-attr'));
|
|
@@ -4873,7 +4872,7 @@ export declare const HOST_TAG_NAME: InjectionToken<string>;
|
|
|
4873
4872
|
* ```
|
|
4874
4873
|
*
|
|
4875
4874
|
* ### Optionally injecting an attribute
|
|
4876
|
-
* ```
|
|
4875
|
+
* ```ts
|
|
4877
4876
|
* @Directive()
|
|
4878
4877
|
* class MyDir {
|
|
4879
4878
|
* attr: string | null = inject(new HostAttributeToken('some-attr'), {optional: true});
|
|
@@ -4925,7 +4924,7 @@ export declare interface HostBindingDecorator {
|
|
|
4925
4924
|
* The following example creates a directive that sets the `valid` and `invalid`
|
|
4926
4925
|
* class, a style color, and an id on the DOM element that has an `ngModel` directive on it.
|
|
4927
4926
|
*
|
|
4928
|
-
* ```
|
|
4927
|
+
* ```ts
|
|
4929
4928
|
* @Directive({selector: '[ngModel]'})
|
|
4930
4929
|
* class NgModelStatus {
|
|
4931
4930
|
* constructor(public control: NgModel) {}
|
|
@@ -4988,7 +4987,7 @@ export declare interface HostBindingDecorator {
|
|
|
4988
4987
|
*
|
|
4989
4988
|
* ## Example
|
|
4990
4989
|
*
|
|
4991
|
-
* ```
|
|
4990
|
+
* ```ts
|
|
4992
4991
|
* const hostBindingOpCodes = [
|
|
4993
4992
|
* ~30, // Select element 30
|
|
4994
4993
|
* 40, 45, MyDir.ɵdir.hostBindings // Invoke host bindings on MyDir on element 30;
|
|
@@ -4999,7 +4998,7 @@ export declare interface HostBindingDecorator {
|
|
|
4999
4998
|
* ```
|
|
5000
4999
|
*
|
|
5001
5000
|
* ## Pseudocode
|
|
5002
|
-
* ```
|
|
5001
|
+
* ```ts
|
|
5003
5002
|
* const hostBindingOpCodes = tView.hostBindingOpCodes;
|
|
5004
5003
|
* if (hostBindingOpCodes === null) return;
|
|
5005
5004
|
* for (let i = 0; i < hostBindingOpCodes.length; i++) {
|
|
@@ -5042,8 +5041,7 @@ export declare interface HostDecorator {
|
|
|
5042
5041
|
*
|
|
5043
5042
|
* The following shows use with the `@Optional` decorator, and allows for a `null` result.
|
|
5044
5043
|
*
|
|
5045
|
-
*
|
|
5046
|
-
* </code-example>
|
|
5044
|
+
* {@example core/di/ts/metadata_spec.ts region='Host'}
|
|
5047
5045
|
*
|
|
5048
5046
|
* For an extended example, see ["Dependency Injection
|
|
5049
5047
|
* Guide"](guide/di/di-in-action#optional).
|
|
@@ -5232,7 +5230,7 @@ declare const I18N_DATA = "l";
|
|
|
5232
5230
|
* The number is shifted and encoded according to `I18nCreateOpCode`
|
|
5233
5231
|
*
|
|
5234
5232
|
* Pseudocode:
|
|
5235
|
-
* ```
|
|
5233
|
+
* ```ts
|
|
5236
5234
|
* const i18nCreateOpCodes = [
|
|
5237
5235
|
* 10 << I18nCreateOpCode.SHIFT, "Text Node add to DOM",
|
|
5238
5236
|
* 11 << I18nCreateOpCode.SHIFT | I18nCreateOpCode.COMMENT, "Comment Node add to DOM",
|
|
@@ -5523,7 +5521,7 @@ export declare type ImportedNgModuleProviders = EnvironmentProviders;
|
|
|
5523
5521
|
* @usageNotes
|
|
5524
5522
|
* The results of the `importProvidersFrom` call can be used in the `bootstrapApplication` call:
|
|
5525
5523
|
*
|
|
5526
|
-
* ```
|
|
5524
|
+
* ```ts
|
|
5527
5525
|
* await bootstrapApplication(RootComponent, {
|
|
5528
5526
|
* providers: [
|
|
5529
5527
|
* importProvidersFrom(NgModuleOne, NgModuleTwo)
|
|
@@ -5534,7 +5532,7 @@ export declare type ImportedNgModuleProviders = EnvironmentProviders;
|
|
|
5534
5532
|
* You can also use the `importProvidersFrom` results in the `providers` field of a route, when a
|
|
5535
5533
|
* standalone component is used:
|
|
5536
5534
|
*
|
|
5537
|
-
* ```
|
|
5535
|
+
* ```ts
|
|
5538
5536
|
* export const ROUTES: Route[] = [
|
|
5539
5537
|
* {
|
|
5540
5538
|
* path: 'foo',
|
|
@@ -5748,7 +5746,7 @@ export declare interface InjectableDecorator {
|
|
|
5748
5746
|
* The following example shows how a service class is properly
|
|
5749
5747
|
* marked so that a supporting service can be injected upon creation.
|
|
5750
5748
|
*
|
|
5751
|
-
*
|
|
5749
|
+
* {@example core/di/ts/metadata_spec.ts region='Injectable'}
|
|
5752
5750
|
*
|
|
5753
5751
|
*/
|
|
5754
5752
|
(): TypeDecorator;
|
|
@@ -5801,8 +5799,7 @@ export declare interface InjectDecorator {
|
|
|
5801
5799
|
* When `@Inject()` is not present, the injector uses the type annotation of the
|
|
5802
5800
|
* parameter as the provider.
|
|
5803
5801
|
*
|
|
5804
|
-
*
|
|
5805
|
-
* </code-example>
|
|
5802
|
+
* {@example core/di/ts/metadata_spec.ts region='InjectWithoutDecorator'}
|
|
5806
5803
|
*
|
|
5807
5804
|
* @see [Dependency Injection Guide](guide/di/dependency-injection
|
|
5808
5805
|
*
|
|
@@ -5882,8 +5879,7 @@ export declare enum InjectFlags {
|
|
|
5882
5879
|
*
|
|
5883
5880
|
* </div>
|
|
5884
5881
|
*
|
|
5885
|
-
*
|
|
5886
|
-
* region="InjectionToken"></code-example>
|
|
5882
|
+
* {@example injection-token/src/main.ts region='InjectionToken'}
|
|
5887
5883
|
*
|
|
5888
5884
|
* When creating an `InjectionToken`, you can optionally specify a factory function which returns
|
|
5889
5885
|
* (possibly by creating) a default value of the parameterized type `T`. This sets up the
|
|
@@ -6132,7 +6128,7 @@ export declare const Input: InputDecorator;
|
|
|
6132
6128
|
* @usageNotes
|
|
6133
6129
|
* To use signal-based inputs, import `input` from `@angular/core`.
|
|
6134
6130
|
*
|
|
6135
|
-
* ```
|
|
6131
|
+
* ```ts
|
|
6136
6132
|
* import {input} from '@angular/core`;
|
|
6137
6133
|
* ```
|
|
6138
6134
|
*
|
|
@@ -6181,7 +6177,7 @@ export declare interface InputDecorator {
|
|
|
6181
6177
|
* The following example creates a component with two input properties,
|
|
6182
6178
|
* one of which is given a special binding name.
|
|
6183
6179
|
*
|
|
6184
|
-
* ```
|
|
6180
|
+
* ```ts
|
|
6185
6181
|
* import { Component, Input, numberAttribute, booleanAttribute } from '@angular/core';
|
|
6186
6182
|
* @Component({
|
|
6187
6183
|
* selector: 'bank-account',
|
|
@@ -6859,7 +6855,7 @@ declare interface Listener {
|
|
|
6859
6855
|
* @usageNotes
|
|
6860
6856
|
* ### Example
|
|
6861
6857
|
*
|
|
6862
|
-
* ```
|
|
6858
|
+
* ```ts
|
|
6863
6859
|
* import { LOCALE_ID } from '@angular/core';
|
|
6864
6860
|
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
6865
6861
|
* import { AppModule } from './app/app.module';
|
|
@@ -7285,7 +7281,7 @@ export declare function makeEnvironmentProviders(providers: (Provider | Environm
|
|
|
7285
7281
|
*
|
|
7286
7282
|
* Example:
|
|
7287
7283
|
*
|
|
7288
|
-
* ```
|
|
7284
|
+
* ```ts
|
|
7289
7285
|
* const COUNTER_KEY = makeStateKey<number>('counter');
|
|
7290
7286
|
* let value = 10;
|
|
7291
7287
|
*
|
|
@@ -7317,7 +7313,7 @@ export declare function mergeApplicationConfig(...configs: ApplicationConfig[]):
|
|
|
7317
7313
|
*
|
|
7318
7314
|
* @usageNotes
|
|
7319
7315
|
* ### Example
|
|
7320
|
-
* ```
|
|
7316
|
+
* ```ts
|
|
7321
7317
|
* import { MissingTranslationStrategy } from '@angular/core';
|
|
7322
7318
|
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
7323
7319
|
* import { AppModule } from './app/app.module';
|
|
@@ -7346,7 +7342,7 @@ export declare enum MissingTranslationStrategy {
|
|
|
7346
7342
|
*
|
|
7347
7343
|
* To use `model()`, import the function from `@angular/core`.
|
|
7348
7344
|
*
|
|
7349
|
-
* ```
|
|
7345
|
+
* ```ts
|
|
7350
7346
|
* import {model} from '@angular/core`;
|
|
7351
7347
|
* ```
|
|
7352
7348
|
*
|
|
@@ -7788,7 +7784,7 @@ export declare class NgProbeToken {
|
|
|
7788
7784
|
* @usageNotes
|
|
7789
7785
|
* ### Example
|
|
7790
7786
|
*
|
|
7791
|
-
* ```
|
|
7787
|
+
* ```ts
|
|
7792
7788
|
* import {Component, NgZone} from '@angular/core';
|
|
7793
7789
|
* import {NgIf} from '@angular/common';
|
|
7794
7790
|
*
|
|
@@ -8060,7 +8056,7 @@ declare const NUM_ROOT_NODES = "r";
|
|
|
8060
8056
|
* @param fallbackValue Value to use if the provided value can't be parsed as a number.
|
|
8061
8057
|
*
|
|
8062
8058
|
* @usageNotes
|
|
8063
|
-
* ```
|
|
8059
|
+
* ```ts
|
|
8064
8060
|
* @Input({ transform: numberAttribute }) id!: number;
|
|
8065
8061
|
* ```
|
|
8066
8062
|
*
|
|
@@ -8188,8 +8184,7 @@ export declare interface OptionalDecorator {
|
|
|
8188
8184
|
*
|
|
8189
8185
|
* The following code allows the possibility of a `null` result:
|
|
8190
8186
|
*
|
|
8191
|
-
*
|
|
8192
|
-
* </code-example>
|
|
8187
|
+
* {@example core/di/ts/metadata_spec.ts region='Optional'}
|
|
8193
8188
|
*
|
|
8194
8189
|
* @see [Dependency Injection Guide](guide/di/dependency-injection.
|
|
8195
8190
|
*/
|
|
@@ -8370,7 +8365,7 @@ declare const PARENT = 3;
|
|
|
8370
8365
|
* - tests might want to delay assertions until the application becomes stable;
|
|
8371
8366
|
*
|
|
8372
8367
|
* @usageNotes
|
|
8373
|
-
* ```
|
|
8368
|
+
* ```ts
|
|
8374
8369
|
* const pendingTasks = inject(PendingTasks);
|
|
8375
8370
|
* const taskCleanup = pendingTasks.add();
|
|
8376
8371
|
* // do work that should block application's stability and then:
|
|
@@ -8484,7 +8479,7 @@ export declare interface PipeDecorator {
|
|
|
8484
8479
|
* For example, if the name is "myPipe", use a template binding expression
|
|
8485
8480
|
* such as the following:
|
|
8486
8481
|
*
|
|
8487
|
-
* ```
|
|
8482
|
+
* ```html
|
|
8488
8483
|
* {{ exp | myPipe }}
|
|
8489
8484
|
* ```
|
|
8490
8485
|
*
|
|
@@ -8600,7 +8595,7 @@ export declare class PlatformRef {
|
|
|
8600
8595
|
* @usageNotes
|
|
8601
8596
|
* ### Simple Example
|
|
8602
8597
|
*
|
|
8603
|
-
* ```
|
|
8598
|
+
* ```ts
|
|
8604
8599
|
* @NgModule({
|
|
8605
8600
|
* imports: [BrowserModule]
|
|
8606
8601
|
* })
|
|
@@ -8713,7 +8708,7 @@ declare type ProjectionSlots = (ɵCssSelectorList | '*')[];
|
|
|
8713
8708
|
* @usageNotes
|
|
8714
8709
|
* The following example illustrates how to configure an initialization function using
|
|
8715
8710
|
* `provideAppInitializer()`
|
|
8716
|
-
* ```
|
|
8711
|
+
* ```ts
|
|
8717
8712
|
* bootstrapApplication(App, {
|
|
8718
8713
|
* providers: [
|
|
8719
8714
|
* provideAppInitializer(() => {
|
|
@@ -8747,7 +8742,7 @@ export declare function provideAppInitializer(initializerFn: () => Observable<un
|
|
|
8747
8742
|
* @usageNotes
|
|
8748
8743
|
* The following example illustrates how to configure an initialization function using
|
|
8749
8744
|
* `provideEnvironmentInitializer()`
|
|
8750
|
-
* ```
|
|
8745
|
+
* ```ts
|
|
8751
8746
|
* createEnvironmentInjector(
|
|
8752
8747
|
* [
|
|
8753
8748
|
* provideEnvironmentInitializer(() => {
|
|
@@ -8813,7 +8808,7 @@ export declare function provideExperimentalCheckNoChangesForDebug(options: {
|
|
|
8813
8808
|
* - registering a render hook (templates are only refreshed if render hooks do one of the above)
|
|
8814
8809
|
*
|
|
8815
8810
|
* @usageNotes
|
|
8816
|
-
* ```
|
|
8811
|
+
* ```ts
|
|
8817
8812
|
* bootstrapApplication(MyApp, {providers: [
|
|
8818
8813
|
* provideExperimentalZonelessChangeDetection(),
|
|
8819
8814
|
* ]});
|
|
@@ -8873,7 +8868,7 @@ export declare type ProviderToken<T> = Type<T> | AbstractType<T> | InjectionToke
|
|
|
8873
8868
|
* `BootstrapOptions` instead.
|
|
8874
8869
|
*
|
|
8875
8870
|
* @usageNotes
|
|
8876
|
-
* ```
|
|
8871
|
+
* ```ts
|
|
8877
8872
|
* bootstrapApplication(MyApp, {providers: [
|
|
8878
8873
|
* provideZoneChangeDetection({eventCoalescing: true}),
|
|
8879
8874
|
* ]});
|
|
@@ -8972,7 +8967,7 @@ declare const enum QueryFlags {
|
|
|
8972
8967
|
*
|
|
8973
8968
|
* @usageNotes
|
|
8974
8969
|
* ### Example
|
|
8975
|
-
* ```
|
|
8970
|
+
* ```ts
|
|
8976
8971
|
* @Component({...})
|
|
8977
8972
|
* class Container {
|
|
8978
8973
|
* @ViewChildren(Item) items:QueryList<Item>;
|
|
@@ -9249,7 +9244,7 @@ declare interface ReactiveLViewConsumer extends ReactiveNode {
|
|
|
9249
9244
|
* The example below demonstrates how to use the function and how the fields
|
|
9250
9245
|
* of the returned object map to the component metadata.
|
|
9251
9246
|
*
|
|
9252
|
-
* ```
|
|
9247
|
+
* ```angular-ts
|
|
9253
9248
|
* @Component({
|
|
9254
9249
|
* standalone: true,
|
|
9255
9250
|
* selector: 'foo-component',
|
|
@@ -10011,8 +10006,7 @@ export declare interface SelfDecorator {
|
|
|
10011
10006
|
* by the local injector when instantiating the class itself, but not
|
|
10012
10007
|
* when instantiating a child.
|
|
10013
10008
|
*
|
|
10014
|
-
*
|
|
10015
|
-
* </code-example>
|
|
10009
|
+
* {@example core/di/ts/metadata_spec.ts region='Self'}
|
|
10016
10010
|
*
|
|
10017
10011
|
* @see {@link SkipSelf}
|
|
10018
10012
|
* @see {@link Optional}
|
|
@@ -10214,8 +10208,7 @@ export declare interface SkipSelfDecorator {
|
|
|
10214
10208
|
* In the following example, the dependency can be resolved when
|
|
10215
10209
|
* instantiating a child, but not when instantiating the class itself.
|
|
10216
10210
|
*
|
|
10217
|
-
*
|
|
10218
|
-
* </code-example>
|
|
10211
|
+
* {@example core/di/ts/metadata_spec.ts region='SkipSelf'}
|
|
10219
10212
|
*
|
|
10220
10213
|
* @see [Dependency Injection guide](guide/di/di-in-action#skip).
|
|
10221
10214
|
* @see {@link Self}
|
|
@@ -10247,7 +10240,7 @@ declare interface StandaloneCompScopeData extends ScopeData {
|
|
|
10247
10240
|
*
|
|
10248
10241
|
* Example:
|
|
10249
10242
|
*
|
|
10250
|
-
* ```
|
|
10243
|
+
* ```ts
|
|
10251
10244
|
* const COUNTER_KEY = makeStateKey<number>('counter');
|
|
10252
10245
|
* let value = 10;
|
|
10253
10246
|
*
|
|
@@ -10571,7 +10564,7 @@ declare const TEMPLATES = "t";
|
|
|
10571
10564
|
* providers using the `provideProtractorTestingSupport()` function and adding them into the
|
|
10572
10565
|
* `options.providers` array. Example:
|
|
10573
10566
|
*
|
|
10574
|
-
* ```
|
|
10567
|
+
* ```ts
|
|
10575
10568
|
* import {provideProtractorTestingSupport} from '@angular/platform-browser';
|
|
10576
10569
|
*
|
|
10577
10570
|
* await bootstrapApplication(RootComponent, providers: [provideProtractorTestingSupport()]);
|
|
@@ -11494,7 +11487,7 @@ export declare class TransferState {
|
|
|
11494
11487
|
* @usageNotes
|
|
11495
11488
|
* ### Example
|
|
11496
11489
|
*
|
|
11497
|
-
* ```
|
|
11490
|
+
* ```ts
|
|
11498
11491
|
* import { TRANSLATIONS } from '@angular/core';
|
|
11499
11492
|
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
11500
11493
|
* import { AppModule } from './app/app.module';
|
|
@@ -11520,7 +11513,7 @@ export declare const TRANSLATIONS: InjectionToken<string>;
|
|
|
11520
11513
|
* @usageNotes
|
|
11521
11514
|
* ### Example
|
|
11522
11515
|
*
|
|
11523
|
-
* ```
|
|
11516
|
+
* ```ts
|
|
11524
11517
|
* import { TRANSLATIONS_FORMAT } from '@angular/core';
|
|
11525
11518
|
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
11526
11519
|
* import { AppModule } from './app/app.module';
|
|
@@ -11632,7 +11625,7 @@ declare type TStylingRange = number & {
|
|
|
11632
11625
|
*
|
|
11633
11626
|
* Imagine we have:
|
|
11634
11627
|
*
|
|
11635
|
-
* ```
|
|
11628
|
+
* ```angular-ts
|
|
11636
11629
|
* <div class="TEMPLATE" my-dir>
|
|
11637
11630
|
*
|
|
11638
11631
|
* @Directive({
|
|
@@ -11645,7 +11638,7 @@ declare type TStylingRange = number & {
|
|
|
11645
11638
|
*
|
|
11646
11639
|
* In the above case the linked list will contain one item:
|
|
11647
11640
|
*
|
|
11648
|
-
* ```
|
|
11641
|
+
* ```ts
|
|
11649
11642
|
* // assume binding location: 10 for `ɵɵclassProp('dynamic', ctx.exp);`
|
|
11650
11643
|
* tData[10] = <TStylingStatic>[
|
|
11651
11644
|
* '': 'dynamic', // This is the wrapped value of `TStylingKey`
|
|
@@ -11662,13 +11655,13 @@ declare type TStylingRange = number & {
|
|
|
11662
11655
|
* `dynamic` (there is not). Therefore it is safe to remove it.
|
|
11663
11656
|
*
|
|
11664
11657
|
* If setting `true` case:
|
|
11665
|
-
* ```
|
|
11658
|
+
* ```ts
|
|
11666
11659
|
* lView[10] = true; // assume `ctx.exp` is `true`
|
|
11667
11660
|
* lView[10 + 1] = true; // Just normalized `lView[10]`
|
|
11668
11661
|
* ```
|
|
11669
11662
|
* So when the function is resolving styling value, it first needs to look into the linked list
|
|
11670
11663
|
* (there is none) and than into `TNode.residualClass` (TNode.residualStyle) which contains
|
|
11671
|
-
* ```
|
|
11664
|
+
* ```ts
|
|
11672
11665
|
* tNode.residualClass = [
|
|
11673
11666
|
* 'TEMPLATE': true,
|
|
11674
11667
|
* ];
|
|
@@ -11986,7 +11979,7 @@ declare type Type_2 = Function;
|
|
|
11986
11979
|
* An interface implemented by all Angular type decorators, which allows them to be used as
|
|
11987
11980
|
* decorators as well as Angular syntax.
|
|
11988
11981
|
*
|
|
11989
|
-
* ```
|
|
11982
|
+
* ```ts
|
|
11990
11983
|
* @ng.Component({...})
|
|
11991
11984
|
* class MyClass {...}
|
|
11992
11985
|
* ```
|
|
@@ -12119,7 +12112,7 @@ export declare const ViewChild: ViewChildDecorator;
|
|
|
12119
12112
|
* Create a child query in your component by declaring a
|
|
12120
12113
|
* class field and initializing it with the `viewChild()` function.
|
|
12121
12114
|
*
|
|
12122
|
-
* ```ts
|
|
12115
|
+
* ```angular-ts
|
|
12123
12116
|
* @Component({template: '<div #el></div><my-component #cmp />'})
|
|
12124
12117
|
* export class TestComponent {
|
|
12125
12118
|
* divEl = viewChild<ElementRef>('el'); // Signal<ElementRef|undefined>
|
|
@@ -12356,7 +12349,7 @@ export declare interface ViewChildrenDecorator {
|
|
|
12356
12349
|
* Note: the example uses standalone components, but the function can also be used for
|
|
12357
12350
|
* non-standalone components (declared in an NgModule) as well.
|
|
12358
12351
|
*
|
|
12359
|
-
* ```
|
|
12352
|
+
* ```angular-ts
|
|
12360
12353
|
* @Component({
|
|
12361
12354
|
* standalone: true,
|
|
12362
12355
|
* selector: 'dynamic',
|
|
@@ -13913,7 +13906,7 @@ export declare class ɵLContext {
|
|
|
13913
13906
|
*
|
|
13914
13907
|
* Example:
|
|
13915
13908
|
*
|
|
13916
|
-
* ```
|
|
13909
|
+
* ```ts
|
|
13917
13910
|
* renderComponent(AppComponent, {hostFeatures: [LifecycleHooksFeature]});
|
|
13918
13911
|
* ```
|
|
13919
13912
|
*/
|
|
@@ -14392,7 +14385,7 @@ export declare function ɵresetJitOptions(): void;
|
|
|
14392
14385
|
* Used to resolve resource URLs on `@Component` when used with JIT compilation.
|
|
14393
14386
|
*
|
|
14394
14387
|
* Example:
|
|
14395
|
-
* ```
|
|
14388
|
+
* ```ts
|
|
14396
14389
|
* @Component({
|
|
14397
14390
|
* selector: 'my-comp',
|
|
14398
14391
|
* templateUrl: 'my-comp.html', // This requires asynchronous resolution
|
|
@@ -14431,7 +14424,7 @@ export declare function ɵrestoreComponentResolutionQueue(queue: Map<Type<any>,
|
|
|
14431
14424
|
* Formats and outputs the error message in a consistent way.
|
|
14432
14425
|
*
|
|
14433
14426
|
* Example:
|
|
14434
|
-
* ```
|
|
14427
|
+
* ```ts
|
|
14435
14428
|
* throw new RuntimeError(
|
|
14436
14429
|
* RuntimeErrorCode.INJECTOR_ALREADY_DESTROYED,
|
|
14437
14430
|
* ngDevMode && 'Injector has already been destroyed.');
|
|
@@ -14871,7 +14864,7 @@ export declare class ɵViewRef<T> implements EmbeddedViewRef<T>, ChangeDetectorR
|
|
|
14871
14864
|
* @usageNotes
|
|
14872
14865
|
* ### Example
|
|
14873
14866
|
*
|
|
14874
|
-
* ```
|
|
14867
|
+
* ```ts
|
|
14875
14868
|
* @Component({
|
|
14876
14869
|
* selector: 'app-root',
|
|
14877
14870
|
* template: `Number of ticks: {{numberOfTicks}}`
|
|
@@ -14911,7 +14904,7 @@ export declare class ɵViewRef<T> implements EmbeddedViewRef<T>, ChangeDetectorR
|
|
|
14911
14904
|
* we want to check and update the list every five seconds. We can do that by detaching
|
|
14912
14905
|
* the component's change detector and doing a local check every five seconds.
|
|
14913
14906
|
*
|
|
14914
|
-
* ```
|
|
14907
|
+
* ```ts
|
|
14915
14908
|
* class DataProvider {
|
|
14916
14909
|
* // in a real application the returned data will be different every time
|
|
14917
14910
|
* get data() {
|
|
@@ -14961,7 +14954,7 @@ export declare class ɵViewRef<T> implements EmbeddedViewRef<T>, ChangeDetectorR
|
|
|
14961
14954
|
* its change detector from the main change detector tree when the component's live property
|
|
14962
14955
|
* is set to false.
|
|
14963
14956
|
*
|
|
14964
|
-
* ```
|
|
14957
|
+
* ```ts
|
|
14965
14958
|
* class DataProvider {
|
|
14966
14959
|
* data = 1;
|
|
14967
14960
|
*
|
|
@@ -15075,18 +15068,18 @@ export declare function ɵwithIncrementalHydration(): Provider[];
|
|
|
15075
15068
|
*
|
|
15076
15069
|
* USAGE:
|
|
15077
15070
|
* Given:
|
|
15078
|
-
* ```
|
|
15071
|
+
* ```ts
|
|
15079
15072
|
* interface Person {readonly name: string}
|
|
15080
15073
|
* ```
|
|
15081
15074
|
*
|
|
15082
15075
|
* We would like to get a read/write version of `Person`.
|
|
15083
|
-
* ```
|
|
15076
|
+
* ```ts
|
|
15084
15077
|
* const WritablePerson = Writable<Person>;
|
|
15085
15078
|
* ```
|
|
15086
15079
|
*
|
|
15087
15080
|
* The result is that you can do:
|
|
15088
15081
|
*
|
|
15089
|
-
* ```
|
|
15082
|
+
* ```ts
|
|
15090
15083
|
* const readonlyPerson: Person = {name: 'Marry'};
|
|
15091
15084
|
* readonlyPerson.name = 'John'; // TypeError
|
|
15092
15085
|
* (readonlyPerson as WritablePerson).name = 'John'; // OK
|
|
@@ -16027,7 +16020,7 @@ export declare function ɵɵdeferWhen(rawValue: unknown): void;
|
|
|
16027
16020
|
*
|
|
16028
16021
|
*
|
|
16029
16022
|
* # Example
|
|
16030
|
-
* ```
|
|
16023
|
+
* ```ts
|
|
16031
16024
|
* class MyComponent {
|
|
16032
16025
|
* // Generated by Angular Template Compiler
|
|
16033
16026
|
* // [Symbol] syntax will not be supported by TypeScript until v2.7
|
|
@@ -16131,7 +16124,7 @@ export declare function ɵɵdefineNgModule<T>(def: {
|
|
|
16131
16124
|
* Create a pipe definition object.
|
|
16132
16125
|
*
|
|
16133
16126
|
* # Example
|
|
16134
|
-
* ```
|
|
16127
|
+
* ```ts
|
|
16135
16128
|
* class MyPipe implements PipeTransform {
|
|
16136
16129
|
* // Generated by Angular Template Compiler
|
|
16137
16130
|
* static ɵpipe = definePipe({
|
|
@@ -16202,7 +16195,7 @@ export declare function ɵɵdirectiveInject<T>(token: ProviderToken<T>, flags: I
|
|
|
16202
16195
|
* Disables directive matching on element.
|
|
16203
16196
|
*
|
|
16204
16197
|
* * Example:
|
|
16205
|
-
* ```
|
|
16198
|
+
* ```html
|
|
16206
16199
|
* <my-comp my-directive>
|
|
16207
16200
|
* Should match component / directive.
|
|
16208
16201
|
* </my-comp>
|
|
@@ -16300,7 +16293,7 @@ export declare function ɵɵelementStart(index: number, name: string, attrsIndex
|
|
|
16300
16293
|
* Enables directive matching on elements.
|
|
16301
16294
|
*
|
|
16302
16295
|
* * Example:
|
|
16303
|
-
* ```
|
|
16296
|
+
* ```html
|
|
16304
16297
|
* <my-comp my-directive>
|
|
16305
16298
|
* Should match component / directive.
|
|
16306
16299
|
* </my-comp>
|
|
@@ -16807,7 +16800,7 @@ export declare type ɵɵNgModuleDeclaration<T, Declarations, Imports, Exports> =
|
|
|
16807
16800
|
*
|
|
16808
16801
|
* Example usage:
|
|
16809
16802
|
*
|
|
16810
|
-
* ```
|
|
16803
|
+
* ```ts
|
|
16811
16804
|
* static ɵcmp = defineComponent({
|
|
16812
16805
|
* ...
|
|
16813
16806
|
* inputs: {name: 'publicName'},
|