@angular/core 8.1.0-next.3 → 8.1.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/bundles/core-testing.umd.js +1 -1
- package/bundles/core-testing.umd.min.js +1 -1
- package/bundles/core-testing.umd.min.js.map +1 -1
- package/bundles/core.umd.js +282 -234
- package/bundles/core.umd.js.map +1 -1
- package/bundles/core.umd.min.js +61 -61
- package/bundles/core.umd.min.js.map +1 -1
- package/core.d.ts +218 -233
- package/core.metadata.json +1 -1
- package/esm2015/index.js +2 -2
- package/esm2015/public_api.js +2 -2
- package/esm2015/src/change_detection/pipe_transform.js +4 -6
- package/esm2015/src/core.js +2 -2
- package/esm2015/src/core_render3_private_export.js +2 -2
- package/esm2015/src/di/index.js +1 -1
- package/esm2015/src/di/injectable.js +1 -1
- package/esm2015/src/di/interface/provider.js +1 -1
- package/esm2015/src/di/metadata.js +1 -1
- package/esm2015/src/event_emitter.js +3 -10
- package/esm2015/src/linker/component_factory.js +9 -3
- package/esm2015/src/linker/component_factory_resolver.js +9 -2
- package/esm2015/src/metadata/di.js +1 -1
- package/esm2015/src/metadata/directives.js +4 -3
- package/esm2015/src/reflection/reflection_capabilities.js +2 -2
- package/esm2015/src/render3/component.js +6 -2
- package/esm2015/src/render3/component_ref.js +6 -2
- package/esm2015/src/render3/i18n.js +15 -10
- package/esm2015/src/render3/index.js +2 -2
- package/esm2015/src/render3/instructions/all.js +2 -2
- package/esm2015/src/render3/instructions/attribute.js +5 -4
- package/esm2015/src/render3/instructions/embedded_view.js +5 -2
- package/esm2015/src/render3/instructions/property.js +9 -8
- package/esm2015/src/render3/instructions/shared.js +18 -5
- package/esm2015/src/render3/instructions/text.js +3 -3
- package/esm2015/src/render3/interfaces/container.js +6 -2
- package/esm2015/src/render3/interfaces/i18n.js +1 -17
- package/esm2015/src/render3/interfaces/node.js +2 -2
- package/esm2015/src/render3/interfaces/view.js +2 -2
- package/esm2015/src/render3/jit/environment.js +1 -2
- package/esm2015/src/render3/node_manipulation.js +212 -191
- package/esm2015/src/render3/state.js +6 -3
- package/esm2015/src/render3/util/view_traversal_utils.js +7 -2
- package/esm2015/src/render3/view_engine_compatibility.js +39 -12
- package/esm2015/src/util/assert.js +3 -2
- package/esm2015/src/util/decorators.js +1 -1
- package/esm2015/src/version.js +1 -1
- package/esm5/src/change_detection/pipe_transform.js +1 -1
- package/esm5/src/core_render3_private_export.js +2 -2
- package/esm5/src/di/index.js +1 -1
- package/esm5/src/di/injectable.js +1 -1
- package/esm5/src/di/interface/provider.js +1 -1
- package/esm5/src/di/metadata.js +1 -1
- package/esm5/src/event_emitter.js +3 -10
- package/esm5/src/linker/component_factory.js +7 -1
- package/esm5/src/linker/component_factory_resolver.js +7 -1
- package/esm5/src/metadata/di.js +1 -1
- package/esm5/src/metadata/directives.js +4 -3
- package/esm5/src/reflection/reflection_capabilities.js +2 -2
- package/esm5/src/render3/component.js +5 -2
- package/esm5/src/render3/component_ref.js +5 -2
- package/esm5/src/render3/i18n.js +11 -7
- package/esm5/src/render3/index.js +2 -2
- package/esm5/src/render3/instructions/attribute.js +5 -4
- package/esm5/src/render3/instructions/embedded_view.js +5 -2
- package/esm5/src/render3/instructions/property.js +7 -7
- package/esm5/src/render3/instructions/shared.js +15 -5
- package/esm5/src/render3/instructions/text.js +3 -3
- package/esm5/src/render3/interfaces/container.js +3 -2
- package/esm5/src/render3/interfaces/i18n.js +1 -1
- package/esm5/src/render3/interfaces/node.js +1 -1
- package/esm5/src/render3/interfaces/view.js +1 -1
- package/esm5/src/render3/jit/environment.js +1 -2
- package/esm5/src/render3/node_manipulation.js +179 -187
- package/esm5/src/render3/state.js +6 -3
- package/esm5/src/render3/util/view_traversal_utils.js +7 -2
- package/esm5/src/render3/view_engine_compatibility.js +32 -12
- package/esm5/src/util/assert.js +3 -2
- package/esm5/src/util/decorators.js +1 -1
- package/esm5/src/version.js +1 -1
- package/fesm2015/core.js +335 -242
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/testing.js +1 -1
- package/fesm5/core.js +283 -234
- package/fesm5/core.js.map +1 -1
- package/fesm5/testing.js +1 -1
- package/package.json +1 -1
- package/src/r3_symbols.d.ts +73 -90
- package/testing/testing.d.ts +1 -1
- package/testing.d.ts +1 -1
package/core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v8.1.
|
|
2
|
+
* @license Angular v8.1.2
|
|
3
3
|
* (c) 2010-2019 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -434,7 +434,7 @@ export declare const Attribute: AttributeDecorator;
|
|
|
434
434
|
*/
|
|
435
435
|
export declare interface AttributeDecorator {
|
|
436
436
|
/**
|
|
437
|
-
*
|
|
437
|
+
* Parameter decorator for a directive constructor that designates
|
|
438
438
|
* a host-element attribute whose value is injected as a constant string literal.
|
|
439
439
|
*
|
|
440
440
|
* @usageNotes
|
|
@@ -447,11 +447,11 @@ export declare interface AttributeDecorator {
|
|
|
447
447
|
*
|
|
448
448
|
* The following example uses the decorator to inject the string literal `text`.
|
|
449
449
|
*
|
|
450
|
-
* {@example core/ts/metadata/metadata.ts region='attributeMetadata'}
|
|
450
|
+
* {@example core/ts/metadata/metadata.ts region='attributeMetadata' linenums="false"}
|
|
451
451
|
*
|
|
452
452
|
* ### Example as TypeScript Decorator
|
|
453
453
|
*
|
|
454
|
-
* {@example core/ts/metadata/metadata.ts region='attributeFactory'}
|
|
454
|
+
* {@example core/ts/metadata/metadata.ts region='attributeFactory' linenums="false"}
|
|
455
455
|
*
|
|
456
456
|
*/
|
|
457
457
|
(name: string): any;
|
|
@@ -630,21 +630,19 @@ declare const CHILD_TAIL = 15;
|
|
|
630
630
|
|
|
631
631
|
/**
|
|
632
632
|
* Configures the `Injector` to return an instance of `useClass` for a token.
|
|
633
|
-
*
|
|
634
|
-
* For more details, see the ["Dependency Injection Guide"](guide/dependency-injection).
|
|
633
|
+
* @see ["Dependency Injection Guide"](guide/dependency-injection).
|
|
635
634
|
*
|
|
636
635
|
* @usageNotes
|
|
637
|
-
* ### Example
|
|
638
636
|
*
|
|
639
|
-
* {@example core/di/ts/provider_spec.ts region='ClassProvider'}
|
|
637
|
+
* {@example core/di/ts/provider_spec.ts region='ClassProvider' linenums="false"}
|
|
640
638
|
*
|
|
641
639
|
* Note that following two providers are not equal:
|
|
642
640
|
*
|
|
643
|
-
* {@example core/di/ts/provider_spec.ts region='ClassProviderDifference'}
|
|
641
|
+
* {@example core/di/ts/provider_spec.ts region='ClassProviderDifference' linenums="false"}
|
|
644
642
|
*
|
|
645
643
|
* ### Multi-value example
|
|
646
644
|
*
|
|
647
|
-
* {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
|
|
645
|
+
* {@example core/di/ts/provider_spec.ts region='MultiProviderAspect' linenums="false"}
|
|
648
646
|
*
|
|
649
647
|
* @publicApi
|
|
650
648
|
*/
|
|
@@ -654,7 +652,7 @@ export declare interface ClassProvider extends ClassSansProvider {
|
|
|
654
652
|
*/
|
|
655
653
|
provide: any;
|
|
656
654
|
/**
|
|
657
|
-
*
|
|
655
|
+
* When true, injector returns an array of instances. This is useful to allow multiple
|
|
658
656
|
* providers spread across many files to provide configuration information to a common token.
|
|
659
657
|
*/
|
|
660
658
|
multi?: boolean;
|
|
@@ -662,17 +660,13 @@ export declare interface ClassProvider extends ClassSansProvider {
|
|
|
662
660
|
|
|
663
661
|
/**
|
|
664
662
|
* Configures the `Injector` to return a value by invoking a `useClass` function.
|
|
663
|
+
* Base for `ClassProvider` decorator.
|
|
665
664
|
*
|
|
666
|
-
*
|
|
667
|
-
*
|
|
668
|
-
* @usageNotes
|
|
669
|
-
* ### Example
|
|
670
|
-
*
|
|
671
|
-
* {@example core/di/ts/provider_spec.ts region='ClassSansProvider'}
|
|
665
|
+
* @see ["Dependency Injection Guide"](guide/dependency-injection).
|
|
672
666
|
*
|
|
673
667
|
* @publicApi
|
|
674
668
|
*/
|
|
675
|
-
declare interface ClassSansProvider {
|
|
669
|
+
export declare interface ClassSansProvider {
|
|
676
670
|
/**
|
|
677
671
|
* Class to instantiate for the `token`.
|
|
678
672
|
*/
|
|
@@ -913,7 +907,8 @@ export declare interface ComponentDecorator {
|
|
|
913
907
|
* The following example creates a component with two data-bound properties,
|
|
914
908
|
* specified by the `inputs` value.
|
|
915
909
|
*
|
|
916
|
-
* <code-example path="core/ts/metadata/directives.ts" region="component-input"
|
|
910
|
+
* <code-example path="core/ts/metadata/directives.ts" region="component-input"
|
|
911
|
+
* linenums="false">
|
|
917
912
|
* </code-example>
|
|
918
913
|
*
|
|
919
914
|
*
|
|
@@ -922,14 +917,15 @@ export declare interface ComponentDecorator {
|
|
|
922
917
|
* The following example shows two event emitters that emit on an interval. One
|
|
923
918
|
* emits an output every second, while the other emits every five seconds.
|
|
924
919
|
*
|
|
925
|
-
* {@example core/ts/metadata/directives.ts region='component-output-interval
|
|
920
|
+
* {@example core/ts/metadata/directives.ts region='component-output-interval
|
|
921
|
+
* linenums="false"}
|
|
926
922
|
*
|
|
927
923
|
* ### Injecting a class with a view provider
|
|
928
924
|
*
|
|
929
925
|
* The following simple example injects a class into a component
|
|
930
926
|
* using the view provider specified in component metadata:
|
|
931
927
|
*
|
|
932
|
-
* ```
|
|
928
|
+
* ```ts
|
|
933
929
|
* class Greeter {
|
|
934
930
|
* greet(name:string) {
|
|
935
931
|
* return 'Hello ' + name + '!';
|
|
@@ -970,13 +966,13 @@ export declare interface ComponentDecorator {
|
|
|
970
966
|
* * Trims all whitespaces at the beginning and the end of a template.
|
|
971
967
|
* * Removes whitespace-only text nodes. For example,
|
|
972
968
|
*
|
|
973
|
-
* ```
|
|
969
|
+
* ```html
|
|
974
970
|
* <button>Action 1</button> <button>Action 2</button>
|
|
975
971
|
* ```
|
|
976
972
|
*
|
|
977
973
|
* becomes:
|
|
978
974
|
*
|
|
979
|
-
* ```
|
|
975
|
+
* ```html
|
|
980
976
|
* <button>Action 1</button><button>Action 2</button>
|
|
981
977
|
* ```
|
|
982
978
|
*
|
|
@@ -1044,6 +1040,12 @@ declare interface ComponentDefFeature {
|
|
|
1044
1040
|
}
|
|
1045
1041
|
|
|
1046
1042
|
/**
|
|
1043
|
+
* Base class for a factory that can create a component dynamically.
|
|
1044
|
+
* Instantiate a factory for a given type of component with `resolveComponentFactory()`.
|
|
1045
|
+
* Use the resulting `ComponentFactory.create()` method to create a component of that type.
|
|
1046
|
+
*
|
|
1047
|
+
* @see [Dynamic Components](guide/dynamic-component-loader)
|
|
1048
|
+
*
|
|
1047
1049
|
* @publicApi
|
|
1048
1050
|
*/
|
|
1049
1051
|
declare abstract class ComponentFactory<C> {
|
|
@@ -1052,7 +1054,7 @@ declare abstract class ComponentFactory<C> {
|
|
|
1052
1054
|
*/
|
|
1053
1055
|
abstract readonly selector: string;
|
|
1054
1056
|
/**
|
|
1055
|
-
* The component
|
|
1057
|
+
* The type of component the factory will create.
|
|
1056
1058
|
*/
|
|
1057
1059
|
abstract readonly componentType: Type<any>;
|
|
1058
1060
|
/**
|
|
@@ -1082,10 +1084,20 @@ export { ComponentFactory }
|
|
|
1082
1084
|
export { ComponentFactory as ɵComponentFactory }
|
|
1083
1085
|
|
|
1084
1086
|
/**
|
|
1087
|
+
* A simple registry that maps `Components` to generated `ComponentFactory` classes
|
|
1088
|
+
* that can be used to create instances of components.
|
|
1089
|
+
* Use to obtain the factory for a given component type,
|
|
1090
|
+
* then use the factory's `create()` method to create a component of that type.
|
|
1091
|
+
*
|
|
1092
|
+
* @see [Dynamic Components](guide/dynamic-component-loader)
|
|
1085
1093
|
* @publicApi
|
|
1086
1094
|
*/
|
|
1087
1095
|
export declare abstract class ComponentFactoryResolver {
|
|
1088
1096
|
static NULL: ComponentFactoryResolver;
|
|
1097
|
+
/**
|
|
1098
|
+
* Retrieves the factory object that creates a component of the given type.
|
|
1099
|
+
* @param component The component type.
|
|
1100
|
+
*/
|
|
1089
1101
|
abstract resolveComponentFactory<T>(component: Type<T>): ComponentFactory<T>;
|
|
1090
1102
|
}
|
|
1091
1103
|
|
|
@@ -1121,7 +1133,7 @@ export declare abstract class ComponentRef<C> {
|
|
|
1121
1133
|
*/
|
|
1122
1134
|
abstract readonly changeDetectorRef: ChangeDetectorRef;
|
|
1123
1135
|
/**
|
|
1124
|
-
* The component
|
|
1136
|
+
* The type of this component (as created by a `ComponentFactory` class).
|
|
1125
1137
|
*/
|
|
1126
1138
|
abstract readonly componentType: Type<any>;
|
|
1127
1139
|
/**
|
|
@@ -1147,24 +1159,25 @@ declare type ComponentTemplate<T> = {
|
|
|
1147
1159
|
/**
|
|
1148
1160
|
* Configures the `Injector` to return an instance of a token.
|
|
1149
1161
|
*
|
|
1150
|
-
*
|
|
1162
|
+
* @see ["Dependency Injection Guide"](guide/dependency-injection).
|
|
1151
1163
|
*
|
|
1152
1164
|
* @usageNotes
|
|
1153
|
-
* ### Example
|
|
1154
1165
|
*
|
|
1155
|
-
* {@example core/di/ts/provider_spec.ts region='ConstructorProvider'}
|
|
1166
|
+
* {@example core/di/ts/provider_spec.ts region='ConstructorProvider' linenums="false"}
|
|
1156
1167
|
*
|
|
1157
1168
|
* ### Multi-value example
|
|
1158
1169
|
*
|
|
1159
|
-
* {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
|
|
1170
|
+
* {@example core/di/ts/provider_spec.ts region='MultiProviderAspect' linenums="false"}
|
|
1171
|
+
*
|
|
1172
|
+
* @publicApi
|
|
1160
1173
|
*/
|
|
1161
|
-
declare interface ConstructorProvider extends ConstructorSansProvider {
|
|
1174
|
+
export declare interface ConstructorProvider extends ConstructorSansProvider {
|
|
1162
1175
|
/**
|
|
1163
|
-
* An injection token.
|
|
1176
|
+
* An injection token. Typically an instance of `Type` or `InjectionToken`, but can be `any`.
|
|
1164
1177
|
*/
|
|
1165
1178
|
provide: Type<any>;
|
|
1166
1179
|
/**
|
|
1167
|
-
*
|
|
1180
|
+
* When true, injector returns an array of instances. This is useful to allow multiple
|
|
1168
1181
|
* providers spread across many files to provide configuration information to a common token.
|
|
1169
1182
|
*/
|
|
1170
1183
|
multi?: boolean;
|
|
@@ -1173,12 +1186,11 @@ declare interface ConstructorProvider extends ConstructorSansProvider {
|
|
|
1173
1186
|
/**
|
|
1174
1187
|
* Configures the `Injector` to return an instance of a token.
|
|
1175
1188
|
*
|
|
1176
|
-
*
|
|
1189
|
+
* @see ["Dependency Injection Guide"](guide/dependency-injection).
|
|
1177
1190
|
*
|
|
1178
1191
|
* @usageNotes
|
|
1179
|
-
* ### Example
|
|
1180
1192
|
*
|
|
1181
|
-
* ```
|
|
1193
|
+
* ```ts
|
|
1182
1194
|
* @Injectable(SomeModule, {deps: []})
|
|
1183
1195
|
* class MyService {}
|
|
1184
1196
|
* ```
|
|
@@ -1187,8 +1199,7 @@ declare interface ConstructorProvider extends ConstructorSansProvider {
|
|
|
1187
1199
|
*/
|
|
1188
1200
|
export declare interface ConstructorSansProvider {
|
|
1189
1201
|
/**
|
|
1190
|
-
* A list of `token`s
|
|
1191
|
-
* used as arguments to the `useClass` constructor.
|
|
1202
|
+
* A list of `token`s to be resolved by the injector.
|
|
1192
1203
|
*/
|
|
1193
1204
|
deps?: any[];
|
|
1194
1205
|
}
|
|
@@ -1219,33 +1230,35 @@ export declare const ContentChild: ContentChildDecorator;
|
|
|
1219
1230
|
*/
|
|
1220
1231
|
export declare interface ContentChildDecorator {
|
|
1221
1232
|
/**
|
|
1222
|
-
*
|
|
1233
|
+
* Parameter decorator that configures a content query.
|
|
1223
1234
|
*
|
|
1224
|
-
*
|
|
1225
|
-
*
|
|
1235
|
+
* Use to get the first element or the directive matching the selector from the content DOM.
|
|
1236
|
+
* If the content DOM changes, and a new child matches the selector,
|
|
1226
1237
|
* the property will be updated.
|
|
1227
1238
|
*
|
|
1228
1239
|
* Content queries are set before the `ngAfterContentInit` callback is called.
|
|
1229
1240
|
*
|
|
1230
1241
|
* **Metadata Properties**:
|
|
1231
1242
|
*
|
|
1232
|
-
* * **selector** -
|
|
1233
|
-
* * **read** - read a different token from the queried element.
|
|
1234
|
-
* * **static** -
|
|
1235
|
-
*
|
|
1236
|
-
*
|
|
1237
|
-
*
|
|
1238
|
-
*
|
|
1243
|
+
* * **selector** - The directive type or the name used for querying.
|
|
1244
|
+
* * **read** - True to read a different token from the queried element.
|
|
1245
|
+
* * **static** - True to resolve query results before change detection runs,
|
|
1246
|
+
* false to resolve after change detection.
|
|
1247
|
+
*
|
|
1248
|
+
* When `static` is not provided, uses the query results to determine the timing of query
|
|
1249
|
+
* resolution. If any query results are inside a nested view (such as `*ngIf`), the query is
|
|
1250
|
+
* resolved after change detection runs. Otherwise, it is resolved before change detection
|
|
1239
1251
|
* runs.
|
|
1240
1252
|
*
|
|
1241
1253
|
* @usageNotes
|
|
1242
|
-
* ### Example
|
|
1243
1254
|
*
|
|
1244
|
-
* {@example core/di/ts/contentChild/content_child_howto.ts region='HowTo'
|
|
1255
|
+
* {@example core/di/ts/contentChild/content_child_howto.ts region='HowTo'
|
|
1256
|
+
* linenums="false"}
|
|
1245
1257
|
*
|
|
1246
1258
|
* ### Example
|
|
1247
1259
|
*
|
|
1248
|
-
* {@example core/di/ts/contentChild/content_child_example.ts region='Component'
|
|
1260
|
+
* {@example core/di/ts/contentChild/content_child_example.ts region='Component'
|
|
1261
|
+
* linenums="false"}
|
|
1249
1262
|
*
|
|
1250
1263
|
* @Annotation
|
|
1251
1264
|
*/
|
|
@@ -1285,33 +1298,34 @@ export declare const ContentChildren: ContentChildrenDecorator;
|
|
|
1285
1298
|
*/
|
|
1286
1299
|
export declare interface ContentChildrenDecorator {
|
|
1287
1300
|
/**
|
|
1288
|
-
*
|
|
1301
|
+
* Parameter decorator that configures a content query.
|
|
1289
1302
|
*
|
|
1290
|
-
*
|
|
1291
|
-
*
|
|
1303
|
+
* Use to get the `QueryList` of elements or directives from the content DOM.
|
|
1304
|
+
* Any time a child element is added, removed, or moved, the query list will be
|
|
1292
1305
|
* updated, and the changes observable of the query list will emit a new value.
|
|
1293
1306
|
*
|
|
1294
1307
|
* Content queries are set before the `ngAfterContentInit` callback is called.
|
|
1295
1308
|
*
|
|
1296
1309
|
* **Metadata Properties**:
|
|
1297
1310
|
*
|
|
1298
|
-
* * **selector** -
|
|
1299
|
-
* * **descendants** - include only direct children
|
|
1300
|
-
* * **read** - read a different token from the queried elements.
|
|
1311
|
+
* * **selector** - The directive type or the name used for querying.
|
|
1312
|
+
* * **descendants** - True to include all descendants, otherwise include only direct children.
|
|
1313
|
+
* * **read** - True to read a different token from the queried elements.
|
|
1301
1314
|
*
|
|
1302
1315
|
* @usageNotes
|
|
1303
|
-
* ### Basic Example
|
|
1304
1316
|
*
|
|
1305
1317
|
* Here is a simple demonstration of how the `ContentChildren` decorator can be used.
|
|
1306
1318
|
*
|
|
1307
|
-
* {@example core/di/ts/contentChildren/content_children_howto.ts region='HowTo'
|
|
1319
|
+
* {@example core/di/ts/contentChildren/content_children_howto.ts region='HowTo'
|
|
1320
|
+
* linenums="false"}
|
|
1308
1321
|
*
|
|
1309
|
-
* ### Tab-pane
|
|
1322
|
+
* ### Tab-pane example
|
|
1310
1323
|
*
|
|
1311
1324
|
* Here is a slightly more realistic example that shows how `ContentChildren` decorators
|
|
1312
1325
|
* can be used to implement a tab pane component.
|
|
1313
1326
|
*
|
|
1314
|
-
* {@example core/di/ts/contentChildren/content_children_example.ts region='Component'
|
|
1327
|
+
* {@example core/di/ts/contentChildren/content_children_example.ts region='Component'
|
|
1328
|
+
* linenums="false"}
|
|
1315
1329
|
*
|
|
1316
1330
|
* @Annotation
|
|
1317
1331
|
*/
|
|
@@ -1665,9 +1679,8 @@ export declare interface Directive {
|
|
|
1665
1679
|
* - `bindingProperty` specifies the DOM property where the value is read from.
|
|
1666
1680
|
*
|
|
1667
1681
|
* When `bindingProperty` is not provided, it is assumed to be equal to `directiveProperty`.
|
|
1668
|
-
* @usageNotes
|
|
1669
1682
|
*
|
|
1670
|
-
*
|
|
1683
|
+
* @usageNotes
|
|
1671
1684
|
*
|
|
1672
1685
|
* The following example creates a component with two data-bound properties.
|
|
1673
1686
|
*
|
|
@@ -1702,21 +1715,28 @@ export declare interface Directive {
|
|
|
1702
1715
|
*
|
|
1703
1716
|
* @usageNotes
|
|
1704
1717
|
*
|
|
1705
|
-
* ### Example
|
|
1706
|
-
*
|
|
1707
1718
|
* ```typescript
|
|
1708
|
-
* @
|
|
1719
|
+
* @Component({
|
|
1709
1720
|
* selector: 'child-dir',
|
|
1710
|
-
*
|
|
1721
|
+
* outputs: [ 'bankNameChange' ]
|
|
1722
|
+
* template: `<input (input)="bankNameChange.emit($event.target.value)" />`
|
|
1711
1723
|
* })
|
|
1712
1724
|
* class ChildDir {
|
|
1725
|
+
* bankNameChange: EventEmitter<string> = new EventEmitter<string>();
|
|
1713
1726
|
* }
|
|
1714
1727
|
*
|
|
1715
1728
|
* @Component({
|
|
1716
1729
|
* selector: 'main',
|
|
1717
|
-
* template:
|
|
1730
|
+
* template: `
|
|
1731
|
+
* {{ bankName }} <child-dir (bankNameChange)="onBankNameChange($event)"></child-dir>
|
|
1732
|
+
* `
|
|
1718
1733
|
* })
|
|
1719
1734
|
* class MainComponent {
|
|
1735
|
+
* bankName: string;
|
|
1736
|
+
*
|
|
1737
|
+
* onBankNameChange(bankName: string) {
|
|
1738
|
+
* this.bankName = bankName;
|
|
1739
|
+
* }
|
|
1720
1740
|
* }
|
|
1721
1741
|
* ```
|
|
1722
1742
|
*
|
|
@@ -1733,9 +1753,7 @@ export declare interface Directive {
|
|
|
1733
1753
|
*
|
|
1734
1754
|
* @usageNotes
|
|
1735
1755
|
*
|
|
1736
|
-
*
|
|
1737
|
-
*
|
|
1738
|
-
* ```
|
|
1756
|
+
* ```ts
|
|
1739
1757
|
* @Directive({
|
|
1740
1758
|
* selector: 'child-dir',
|
|
1741
1759
|
* exportAs: 'child'
|
|
@@ -1761,12 +1779,10 @@ export declare interface Directive {
|
|
|
1761
1779
|
*
|
|
1762
1780
|
* @usageNotes
|
|
1763
1781
|
*
|
|
1764
|
-
* ### Example
|
|
1765
|
-
*
|
|
1766
1782
|
* The following example shows how queries are defined
|
|
1767
1783
|
* and when their results are available in lifecycle hooks:
|
|
1768
1784
|
*
|
|
1769
|
-
* ```
|
|
1785
|
+
* ```ts
|
|
1770
1786
|
* @Component({
|
|
1771
1787
|
* selector: 'someDir',
|
|
1772
1788
|
* queries: {
|
|
@@ -1841,8 +1857,9 @@ export declare const Directive: DirectiveDecorator;
|
|
|
1841
1857
|
*/
|
|
1842
1858
|
export declare interface DirectiveDecorator {
|
|
1843
1859
|
/**
|
|
1844
|
-
*
|
|
1845
|
-
* directives to attach custom behavior to elements in the DOM.
|
|
1860
|
+
* Decorator that marks a class as an Angular directive.
|
|
1861
|
+
* You can define your own directives to attach custom behavior to elements in the DOM.
|
|
1862
|
+
*
|
|
1846
1863
|
* The options provide configuration metadata that determines
|
|
1847
1864
|
* how the directive should be processed, instantiated and used at
|
|
1848
1865
|
* runtime.
|
|
@@ -1854,7 +1871,7 @@ export declare interface DirectiveDecorator {
|
|
|
1854
1871
|
* @usageNotes
|
|
1855
1872
|
* To define a directive, mark the class with the decorator and provide metadata.
|
|
1856
1873
|
*
|
|
1857
|
-
* ```
|
|
1874
|
+
* ```ts
|
|
1858
1875
|
* import {Directive} from '@angular/core';
|
|
1859
1876
|
*
|
|
1860
1877
|
* @Directive({
|
|
@@ -1875,7 +1892,7 @@ export declare interface DirectiveDecorator {
|
|
|
1875
1892
|
* a directive imported from another module.
|
|
1876
1893
|
* List the directive class in the `declarations` field of an NgModule.
|
|
1877
1894
|
*
|
|
1878
|
-
* ```
|
|
1895
|
+
* ```ts
|
|
1879
1896
|
* declarations: [
|
|
1880
1897
|
* AppComponent,
|
|
1881
1898
|
* MyDirective
|
|
@@ -2221,7 +2238,7 @@ export declare class ErrorHandler {
|
|
|
2221
2238
|
* that create event emitters. When the title is clicked, the emitter
|
|
2222
2239
|
* emits an open or close event to toggle the current visibility state.
|
|
2223
2240
|
*
|
|
2224
|
-
* ```
|
|
2241
|
+
* ```html
|
|
2225
2242
|
* @Component({
|
|
2226
2243
|
* selector: 'zippy',
|
|
2227
2244
|
* template: `
|
|
@@ -2250,17 +2267,10 @@ export declare class ErrorHandler {
|
|
|
2250
2267
|
* Access the event object with the `$event` argument passed to the output event
|
|
2251
2268
|
* handler:
|
|
2252
2269
|
*
|
|
2253
|
-
* ```
|
|
2270
|
+
* ```html
|
|
2254
2271
|
* <zippy (open)="onOpen($event)" (close)="onClose($event)"></zippy>
|
|
2255
2272
|
* ```
|
|
2256
2273
|
*
|
|
2257
|
-
* ### Notes
|
|
2258
|
-
*
|
|
2259
|
-
* Uses Rx.Observable but provides an adapter to make it work as specified here:
|
|
2260
|
-
* https://github.com/jhusain/observable-spec
|
|
2261
|
-
*
|
|
2262
|
-
* Once a reference implementation of the spec is available, switch to it.
|
|
2263
|
-
*
|
|
2264
2274
|
* @publicApi
|
|
2265
2275
|
*/
|
|
2266
2276
|
export declare class EventEmitter<T> extends Subject<T> {
|
|
@@ -2295,26 +2305,25 @@ export declare class EventEmitter<T> extends Subject<T> {
|
|
|
2295
2305
|
/**
|
|
2296
2306
|
* Configures the `Injector` to return a value of another `useExisting` token.
|
|
2297
2307
|
*
|
|
2298
|
-
*
|
|
2308
|
+
* @see ["Dependency Injection Guide"](guide/dependency-injection).
|
|
2299
2309
|
*
|
|
2300
2310
|
* @usageNotes
|
|
2301
|
-
* ### Example
|
|
2302
2311
|
*
|
|
2303
|
-
* {@example core/di/ts/provider_spec.ts region='ExistingProvider'}
|
|
2312
|
+
* {@example core/di/ts/provider_spec.ts region='ExistingProvider' linenums="false"}
|
|
2304
2313
|
*
|
|
2305
2314
|
* ### Multi-value example
|
|
2306
2315
|
*
|
|
2307
|
-
* {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
|
|
2316
|
+
* {@example core/di/ts/provider_spec.ts region='MultiProviderAspect' linenums="false"}
|
|
2308
2317
|
*
|
|
2309
2318
|
* @publicApi
|
|
2310
2319
|
*/
|
|
2311
2320
|
export declare interface ExistingProvider extends ExistingSansProvider {
|
|
2312
2321
|
/**
|
|
2313
|
-
* An injection token.
|
|
2322
|
+
* An injection token. Typically an instance of `Type` or `InjectionToken`, but can be `any`.
|
|
2314
2323
|
*/
|
|
2315
2324
|
provide: any;
|
|
2316
2325
|
/**
|
|
2317
|
-
*
|
|
2326
|
+
* When true, injector returns an array of instances. This is useful to allow multiple
|
|
2318
2327
|
* providers spread across many files to provide configuration information to a common token.
|
|
2319
2328
|
*/
|
|
2320
2329
|
multi?: boolean;
|
|
@@ -2323,16 +2332,14 @@ export declare interface ExistingProvider extends ExistingSansProvider {
|
|
|
2323
2332
|
/**
|
|
2324
2333
|
* Configures the `Injector` to return a value of another `useExisting` token.
|
|
2325
2334
|
*
|
|
2326
|
-
*
|
|
2327
|
-
*
|
|
2328
|
-
* @usageNotes
|
|
2329
|
-
* ### Example
|
|
2335
|
+
* @see `ExistingProvider`
|
|
2336
|
+
* @see ["Dependency Injection Guide"](guide/dependency-injection).
|
|
2330
2337
|
*
|
|
2331
|
-
*
|
|
2338
|
+
* @publicApi
|
|
2332
2339
|
*/
|
|
2333
|
-
declare interface ExistingSansProvider {
|
|
2340
|
+
export declare interface ExistingSansProvider {
|
|
2334
2341
|
/**
|
|
2335
|
-
* Existing `token` to return. (
|
|
2342
|
+
* Existing `token` to return. (Equivalent to `injector.get(useExisting)`)
|
|
2336
2343
|
*/
|
|
2337
2344
|
useExisting: any;
|
|
2338
2345
|
}
|
|
@@ -2362,21 +2369,19 @@ declare type FactoryFn<T> = {
|
|
|
2362
2369
|
|
|
2363
2370
|
/**
|
|
2364
2371
|
* Configures the `Injector` to return a value by invoking a `useFactory` function.
|
|
2365
|
-
*
|
|
2366
|
-
* For more details, see the ["Dependency Injection Guide"](guide/dependency-injection).
|
|
2372
|
+
* @see ["Dependency Injection Guide"](guide/dependency-injection).
|
|
2367
2373
|
*
|
|
2368
2374
|
* @usageNotes
|
|
2369
|
-
* ### Example
|
|
2370
2375
|
*
|
|
2371
|
-
* {@example core/di/ts/provider_spec.ts region='FactoryProvider'}
|
|
2376
|
+
* {@example core/di/ts/provider_spec.ts region='FactoryProvider' linenums="false"}
|
|
2372
2377
|
*
|
|
2373
2378
|
* Dependencies can also be marked as optional:
|
|
2374
2379
|
*
|
|
2375
|
-
* {@example core/di/ts/provider_spec.ts region='FactoryProviderOptionalDeps'}
|
|
2380
|
+
* {@example core/di/ts/provider_spec.ts region='FactoryProviderOptionalDeps' linenums="false"}
|
|
2376
2381
|
*
|
|
2377
2382
|
* ### Multi-value example
|
|
2378
2383
|
*
|
|
2379
|
-
* {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
|
|
2384
|
+
* {@example core/di/ts/provider_spec.ts region='MultiProviderAspect' linenums="false"}
|
|
2380
2385
|
*
|
|
2381
2386
|
* @publicApi
|
|
2382
2387
|
*/
|
|
@@ -2386,7 +2391,7 @@ export declare interface FactoryProvider extends FactorySansProvider {
|
|
|
2386
2391
|
*/
|
|
2387
2392
|
provide: any;
|
|
2388
2393
|
/**
|
|
2389
|
-
*
|
|
2394
|
+
* When true, injector returns an array of instances. This is useful to allow multiple
|
|
2390
2395
|
* providers spread across many files to provide configuration information to a common token.
|
|
2391
2396
|
*/
|
|
2392
2397
|
multi?: boolean;
|
|
@@ -2395,23 +2400,19 @@ export declare interface FactoryProvider extends FactorySansProvider {
|
|
|
2395
2400
|
/**
|
|
2396
2401
|
* Configures the `Injector` to return a value by invoking a `useFactory` function.
|
|
2397
2402
|
*
|
|
2398
|
-
*
|
|
2399
|
-
*
|
|
2400
|
-
* @usageNotes
|
|
2401
|
-
* ### Example
|
|
2402
|
-
*
|
|
2403
|
-
* {@example core/di/ts/provider_spec.ts region='FactorySansProvider'}
|
|
2403
|
+
* @see `FactoryProvider`
|
|
2404
|
+
* @see ["Dependency Injection Guide"](guide/dependency-injection).
|
|
2404
2405
|
*
|
|
2405
2406
|
* @publicApi
|
|
2406
2407
|
*/
|
|
2407
|
-
declare interface FactorySansProvider {
|
|
2408
|
+
export declare interface FactorySansProvider {
|
|
2408
2409
|
/**
|
|
2409
2410
|
* A function to invoke to create a value for this `token`. The function is invoked with
|
|
2410
2411
|
* resolved values of `token`s in the `deps` field.
|
|
2411
2412
|
*/
|
|
2412
2413
|
useFactory: Function;
|
|
2413
2414
|
/**
|
|
2414
|
-
* A list of `token`s
|
|
2415
|
+
* A list of `token`s to be resolved by the injector. The list of values is then
|
|
2415
2416
|
* used as arguments to the `useFactory` function.
|
|
2416
2417
|
*/
|
|
2417
2418
|
deps?: any[];
|
|
@@ -2582,7 +2583,7 @@ declare type HostBindingsFunction<T> = <U extends T>(rf: ɵRenderFlags, ctx: U,
|
|
|
2582
2583
|
*/
|
|
2583
2584
|
export declare interface HostDecorator {
|
|
2584
2585
|
/**
|
|
2585
|
-
*
|
|
2586
|
+
* Parameter decorator on a view-provider parameter of a class constructor
|
|
2586
2587
|
* that tells the DI framework to resolve the view by checking injectors of child
|
|
2587
2588
|
* elements, and stop when reaching the host element of the current component.
|
|
2588
2589
|
*
|
|
@@ -2593,7 +2594,8 @@ export declare interface HostDecorator {
|
|
|
2593
2594
|
*
|
|
2594
2595
|
* The following shows use with the `@Optional` decorator, and allows for a null result.
|
|
2595
2596
|
*
|
|
2596
|
-
* <code-example path="core/di/ts/metadata_spec.ts" region="Host"
|
|
2597
|
+
* <code-example path="core/di/ts/metadata_spec.ts" region="Host"
|
|
2598
|
+
* linenums="false"></code-example>
|
|
2597
2599
|
*/
|
|
2598
2600
|
(): any;
|
|
2599
2601
|
new (): Host;
|
|
@@ -2659,7 +2661,7 @@ declare interface HostInstructionsQueue extends Array<number | Function | any[]>
|
|
|
2659
2661
|
*/
|
|
2660
2662
|
export declare interface HostListener {
|
|
2661
2663
|
/**
|
|
2662
|
-
* The
|
|
2664
|
+
* The DOM event to listen for.
|
|
2663
2665
|
*/
|
|
2664
2666
|
eventName?: string;
|
|
2665
2667
|
/**
|
|
@@ -2669,9 +2671,10 @@ export declare interface HostListener {
|
|
|
2669
2671
|
}
|
|
2670
2672
|
|
|
2671
2673
|
/**
|
|
2672
|
-
*
|
|
2674
|
+
* Decorator that binds a DOM event to a host listener and supplies configuration metadata.
|
|
2673
2675
|
* Angular invokes the supplied handler method when the host element emits the specified event,
|
|
2674
2676
|
* and updates the bound element with the result.
|
|
2677
|
+
*
|
|
2675
2678
|
* If the handler method returns false, applies `preventDefault` on the bound element.
|
|
2676
2679
|
*
|
|
2677
2680
|
* @usageNotes
|
|
@@ -2679,7 +2682,7 @@ export declare interface HostListener {
|
|
|
2679
2682
|
* The following example declares a directive
|
|
2680
2683
|
* that attaches a click listener to a button and counts clicks.
|
|
2681
2684
|
*
|
|
2682
|
-
* ```
|
|
2685
|
+
* ```ts
|
|
2683
2686
|
* @Directive({selector: 'button[counting]'})
|
|
2684
2687
|
* class CountClicks {
|
|
2685
2688
|
* numberOfClicks = 0;
|
|
@@ -3145,17 +3148,23 @@ export declare const Injectable: InjectableDecorator;
|
|
|
3145
3148
|
*/
|
|
3146
3149
|
export declare interface InjectableDecorator {
|
|
3147
3150
|
/**
|
|
3148
|
-
*
|
|
3151
|
+
* Decorator that marks a class as available to be
|
|
3152
|
+
* provided and injected as a dependency.
|
|
3149
3153
|
*
|
|
3150
3154
|
* @see [Introduction to Services and DI](guide/architecture-services)
|
|
3151
3155
|
* @see [Dependency Injection Guide](guide/dependency-injection)
|
|
3152
3156
|
*
|
|
3153
3157
|
* @usageNotes
|
|
3154
3158
|
*
|
|
3155
|
-
*
|
|
3156
|
-
*
|
|
3159
|
+
* Marking a class with `@Injectable` ensures that the compiler
|
|
3160
|
+
* will generate the necessary metadata to create the class's
|
|
3161
|
+
* dependencies when the class is injected.
|
|
3162
|
+
*
|
|
3163
|
+
* The following example shows how a service class is properly
|
|
3164
|
+
* marked so that a supporting service can be injected upon creation.
|
|
3157
3165
|
*
|
|
3158
|
-
* <code-example path="core/di/ts/metadata_spec.ts" region="Injectable"
|
|
3166
|
+
* <code-example path="core/di/ts/metadata_spec.ts" region="Injectable"
|
|
3167
|
+
* linenums="false"></code-example>
|
|
3159
3168
|
*
|
|
3160
3169
|
*/
|
|
3161
3170
|
(): TypeDecorator;
|
|
@@ -3201,7 +3210,7 @@ declare function injectChangeDetectorRef(): ChangeDetectorRef;
|
|
|
3201
3210
|
*/
|
|
3202
3211
|
export declare interface InjectDecorator {
|
|
3203
3212
|
/**
|
|
3204
|
-
*
|
|
3213
|
+
* Parameter decorator on a dependency parameter of a class constructor
|
|
3205
3214
|
* that specifies a custom provider of the dependency.
|
|
3206
3215
|
*
|
|
3207
3216
|
* Learn more in the ["Dependency Injection Guide"](guide/dependency-injection).
|
|
@@ -3214,7 +3223,7 @@ export declare interface InjectDecorator {
|
|
|
3214
3223
|
* parameter as the provider.
|
|
3215
3224
|
*
|
|
3216
3225
|
* <code-example path="core/di/ts/metadata_spec.ts"
|
|
3217
|
-
* region="InjectWithoutDecorator"></code-example>
|
|
3226
|
+
* region="InjectWithoutDecorator" linenums="false"></code-example>
|
|
3218
3227
|
*/
|
|
3219
3228
|
(token: any): any;
|
|
3220
3229
|
new (token: any): Inject;
|
|
@@ -3381,7 +3390,7 @@ declare interface InjectorTypeWithProviders<T> {
|
|
|
3381
3390
|
providers?: (Type<any> | ValueProvider | ExistingProvider | FactoryProvider | ConstructorProvider | StaticClassProvider | ClassProvider | any[])[];
|
|
3382
3391
|
}
|
|
3383
3392
|
|
|
3384
|
-
/**
|
|
3393
|
+
/** Injects a Renderer2 for the current component. */
|
|
3385
3394
|
declare function injectRenderer2(): Renderer2;
|
|
3386
3395
|
|
|
3387
3396
|
/**
|
|
@@ -3806,6 +3815,12 @@ declare interface LContainer extends Array<any> {
|
|
|
3806
3815
|
[T_HOST]: TNode;
|
|
3807
3816
|
/** The comment element that serves as an anchor for this LContainer. */
|
|
3808
3817
|
readonly [NATIVE]: RComment;
|
|
3818
|
+
/**
|
|
3819
|
+
* Array of `ViewRef`s used by any `ViewContainerRef`s that point to this container.
|
|
3820
|
+
*
|
|
3821
|
+
* This is lazily initialized by `ViewContainerRef` when the first view is inserted.
|
|
3822
|
+
*/
|
|
3823
|
+
[VIEW_REFS]: ViewRef[] | null;
|
|
3809
3824
|
}
|
|
3810
3825
|
|
|
3811
3826
|
/**
|
|
@@ -4797,7 +4812,7 @@ export declare const Optional: OptionalDecorator;
|
|
|
4797
4812
|
*/
|
|
4798
4813
|
export declare interface OptionalDecorator {
|
|
4799
4814
|
/**
|
|
4800
|
-
*
|
|
4815
|
+
* Parameter decorator to be used on constructor parameters,
|
|
4801
4816
|
* which marks the parameter as being an optional dependency.
|
|
4802
4817
|
* The DI framework provides null if the dependency is not found.
|
|
4803
4818
|
*
|
|
@@ -4810,7 +4825,8 @@ export declare interface OptionalDecorator {
|
|
|
4810
4825
|
*
|
|
4811
4826
|
* The following code allows the possibility of a null result:
|
|
4812
4827
|
*
|
|
4813
|
-
* <code-example path="core/di/ts/metadata_spec.ts" region="Optional"
|
|
4828
|
+
* <code-example path="core/di/ts/metadata_spec.ts" region="Optional"
|
|
4829
|
+
* linenums="false"></code-example>
|
|
4814
4830
|
*
|
|
4815
4831
|
*/
|
|
4816
4832
|
(): any;
|
|
@@ -4952,17 +4968,15 @@ declare type PipeDefListOrFactory = (() => PipeDefList) | PipeDefList;
|
|
|
4952
4968
|
|
|
4953
4969
|
|
|
4954
4970
|
/**
|
|
4955
|
-
*
|
|
4956
|
-
*
|
|
4971
|
+
* An interface that is implemented by pipes in order to perform a transformation.
|
|
4957
4972
|
* Angular invokes the `transform` method with the value of a binding
|
|
4958
4973
|
* as the first argument, and any parameters as the second argument in list form.
|
|
4959
4974
|
*
|
|
4960
4975
|
* @usageNotes
|
|
4961
|
-
* ### Example
|
|
4962
4976
|
*
|
|
4963
|
-
*
|
|
4977
|
+
* In the following example, `RepeatPipe` repeats a given value a given number of times.
|
|
4964
4978
|
*
|
|
4965
|
-
* ```
|
|
4979
|
+
* ```ts
|
|
4966
4980
|
* import {Pipe, PipeTransform} from '@angular/core';
|
|
4967
4981
|
*
|
|
4968
4982
|
* @Pipe({name: 'repeat'})
|
|
@@ -5192,7 +5206,7 @@ declare interface ProceduralRenderer3 {
|
|
|
5192
5206
|
}
|
|
5193
5207
|
|
|
5194
5208
|
/**
|
|
5195
|
-
* Describes a function that is used to process provider
|
|
5209
|
+
* Describes a function that is used to process provider lists (such as provider
|
|
5196
5210
|
* overrides).
|
|
5197
5211
|
*/
|
|
5198
5212
|
declare type ProcessProvidersFunction = (providers: Provider[]) => Provider[];
|
|
@@ -5234,11 +5248,8 @@ declare type PropertyAliasValue = (number | string)[];
|
|
|
5234
5248
|
|
|
5235
5249
|
/**
|
|
5236
5250
|
* Describes how the `Injector` should be configured.
|
|
5251
|
+
* @see ["Dependency Injection Guide"](guide/dependency-injection).
|
|
5237
5252
|
*
|
|
5238
|
-
* For more details, see the ["Dependency Injection Guide"](guide/dependency-injection).
|
|
5239
|
-
*
|
|
5240
|
-
* @see `TypeProvider`
|
|
5241
|
-
* @see `ClassProvider`
|
|
5242
5253
|
* @see `StaticProvider`
|
|
5243
5254
|
*
|
|
5244
5255
|
* @publicApi
|
|
@@ -6331,7 +6342,7 @@ export declare const Self: SelfDecorator;
|
|
|
6331
6342
|
*/
|
|
6332
6343
|
export declare interface SelfDecorator {
|
|
6333
6344
|
/**
|
|
6334
|
-
*
|
|
6345
|
+
* Parameter decorator to be used on constructor parameters,
|
|
6335
6346
|
* which tells the DI framework to start dependency resolution from the local injector.
|
|
6336
6347
|
*
|
|
6337
6348
|
* Resolution works upward through the injector hierarchy, so the children
|
|
@@ -6343,7 +6354,8 @@ export declare interface SelfDecorator {
|
|
|
6343
6354
|
* by the local injector when instantiating the class itself, but not
|
|
6344
6355
|
* when instantiating a child.
|
|
6345
6356
|
*
|
|
6346
|
-
* <code-example path="core/di/ts/metadata_spec.ts" region="Self"
|
|
6357
|
+
* <code-example path="core/di/ts/metadata_spec.ts" region="Self"
|
|
6358
|
+
* linenums="false"></code-example>
|
|
6347
6359
|
*
|
|
6348
6360
|
*
|
|
6349
6361
|
* @see `SkipSelf`
|
|
@@ -6455,7 +6467,7 @@ export declare const SkipSelf: SkipSelfDecorator;
|
|
|
6455
6467
|
*/
|
|
6456
6468
|
export declare interface SkipSelfDecorator {
|
|
6457
6469
|
/**
|
|
6458
|
-
*
|
|
6470
|
+
* Parameter decorator to be used on constructor parameters,
|
|
6459
6471
|
* which tells the DI framework to start dependency resolution from the parent injector.
|
|
6460
6472
|
* Resolution works upward through the injector hierarchy, so the local injector
|
|
6461
6473
|
* is not checked for a provider.
|
|
@@ -6465,7 +6477,8 @@ export declare interface SkipSelfDecorator {
|
|
|
6465
6477
|
* In the following example, the dependency can be resolved when
|
|
6466
6478
|
* instantiating a child, but not when instantiating the class itself.
|
|
6467
6479
|
*
|
|
6468
|
-
* <code-example path="core/di/ts/metadata_spec.ts" region="SkipSelf"
|
|
6480
|
+
* <code-example path="core/di/ts/metadata_spec.ts" region="SkipSelf"
|
|
6481
|
+
* linenums="false"></code-example>
|
|
6469
6482
|
*
|
|
6470
6483
|
* Learn more in the
|
|
6471
6484
|
* [Dependency Injection guide](guide/dependency-injection-in-action#skip).
|
|
@@ -6480,29 +6493,29 @@ export declare interface SkipSelfDecorator {
|
|
|
6480
6493
|
|
|
6481
6494
|
/**
|
|
6482
6495
|
* Configures the `Injector` to return an instance of `useClass` for a token.
|
|
6483
|
-
*
|
|
6484
|
-
* For more details, see the ["Dependency Injection Guide"](guide/dependency-injection).
|
|
6496
|
+
* @see ["Dependency Injection Guide"](guide/dependency-injection).
|
|
6485
6497
|
*
|
|
6486
6498
|
* @usageNotes
|
|
6487
|
-
* ### Example
|
|
6488
6499
|
*
|
|
6489
6500
|
* {@example core/di/ts/provider_spec.ts region='StaticClassProvider'}
|
|
6490
6501
|
*
|
|
6491
6502
|
* Note that following two providers are not equal:
|
|
6492
6503
|
*
|
|
6493
|
-
* {@example core/di/ts/provider_spec.ts region='StaticClassProviderDifference'}
|
|
6504
|
+
* {@example core/di/ts/provider_spec.ts region='StaticClassProviderDifference' linenums="false"}
|
|
6494
6505
|
*
|
|
6495
6506
|
* ### Multi-value example
|
|
6496
6507
|
*
|
|
6497
|
-
* {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
|
|
6508
|
+
* {@example core/di/ts/provider_spec.ts region='MultiProviderAspect' linenums="false"}
|
|
6509
|
+
*
|
|
6510
|
+
* @publicApi
|
|
6498
6511
|
*/
|
|
6499
|
-
declare interface StaticClassProvider extends StaticClassSansProvider {
|
|
6512
|
+
export declare interface StaticClassProvider extends StaticClassSansProvider {
|
|
6500
6513
|
/**
|
|
6501
|
-
* An injection token.
|
|
6514
|
+
* An injection token. Typically an instance of `Type` or `InjectionToken`, but can be `any`.
|
|
6502
6515
|
*/
|
|
6503
6516
|
provide: any;
|
|
6504
6517
|
/**
|
|
6505
|
-
*
|
|
6518
|
+
* When true, injector returns an array of instances. This is useful to allow multiple
|
|
6506
6519
|
* providers spread across many files to provide configuration information to a common token.
|
|
6507
6520
|
*/
|
|
6508
6521
|
multi?: boolean;
|
|
@@ -6510,37 +6523,26 @@ declare interface StaticClassProvider extends StaticClassSansProvider {
|
|
|
6510
6523
|
|
|
6511
6524
|
/**
|
|
6512
6525
|
* Configures the `Injector` to return an instance of `useClass` for a token.
|
|
6513
|
-
*
|
|
6514
|
-
* For more details, see the ["Dependency Injection Guide"](guide/dependency-injection).
|
|
6515
|
-
*
|
|
6516
|
-
* @usageNotes
|
|
6517
|
-
* ### Example
|
|
6518
|
-
*
|
|
6519
|
-
* {@example core/di/ts/provider_spec.ts region='StaticClassSansProvider'}
|
|
6526
|
+
* Base for `StaticClassProvider` decorator.
|
|
6520
6527
|
*
|
|
6521
6528
|
* @publicApi
|
|
6522
6529
|
*/
|
|
6523
|
-
declare interface StaticClassSansProvider {
|
|
6530
|
+
export declare interface StaticClassSansProvider {
|
|
6524
6531
|
/**
|
|
6525
|
-
* An optional class to instantiate for the `token`.
|
|
6526
|
-
* class
|
|
6532
|
+
* An optional class to instantiate for the `token`. By default, the `provide`
|
|
6533
|
+
* class is instantiated.
|
|
6527
6534
|
*/
|
|
6528
6535
|
useClass: Type<any>;
|
|
6529
6536
|
/**
|
|
6530
|
-
* A list of `token`s
|
|
6537
|
+
* A list of `token`s to be resolved by the injector. The list of values is then
|
|
6531
6538
|
* used as arguments to the `useClass` constructor.
|
|
6532
6539
|
*/
|
|
6533
6540
|
deps: any[];
|
|
6534
6541
|
}
|
|
6535
6542
|
|
|
6536
6543
|
/**
|
|
6537
|
-
* Describes how the `Injector` should be configured
|
|
6538
|
-
*
|
|
6539
|
-
* For more details, see the ["Dependency Injection Guide"](guide/dependency-injection).
|
|
6540
|
-
*
|
|
6541
|
-
* @see `ValueProvider`
|
|
6542
|
-
* @see `ExistingProvider`
|
|
6543
|
-
* @see `FactoryProvider`
|
|
6544
|
+
* Describes how the `Injector` should be configured as static (that is, without reflection).
|
|
6545
|
+
* @see ["Dependency Injection Guide"](guide/dependency-injection).
|
|
6544
6546
|
*
|
|
6545
6547
|
* @publicApi
|
|
6546
6548
|
*/
|
|
@@ -7470,7 +7472,7 @@ declare interface TNode {
|
|
|
7470
7472
|
* - This would return the first head node to project:
|
|
7471
7473
|
* `getHost(currentTNode).projection[currentTNode.projection]`.
|
|
7472
7474
|
* - When projecting nodes the parent node retrieved may be a `<ng-content>` node, in which case
|
|
7473
|
-
* the process is recursive in nature
|
|
7475
|
+
* the process is recursive in nature.
|
|
7474
7476
|
*
|
|
7475
7477
|
* If `projection` is of type `RNode[][]` than we have a collection of native nodes passed as
|
|
7476
7478
|
* projectable nodes during dynamic component creation.
|
|
@@ -8049,7 +8051,7 @@ declare interface TView {
|
|
|
8049
8051
|
*/
|
|
8050
8052
|
viewQuery: ViewQueriesFunction<{}> | null;
|
|
8051
8053
|
/**
|
|
8052
|
-
* Pointer to the `TNode`
|
|
8054
|
+
* Pointer to the host `TNode` (not part of this TView).
|
|
8053
8055
|
*
|
|
8054
8056
|
* If this is a `TViewNode` for an `LViewNode`, this is an embedded view of a container.
|
|
8055
8057
|
* We need this pointer to be able to efficiently find this node when inserting the view
|
|
@@ -8269,11 +8271,8 @@ export declare interface Type<T> extends Function {
|
|
|
8269
8271
|
}
|
|
8270
8272
|
|
|
8271
8273
|
/**
|
|
8272
|
-
* An interface implemented by all Angular type decorators, which allows them to be used as
|
|
8273
|
-
* decorators as well as
|
|
8274
|
-
* Angular DSL syntax.
|
|
8275
|
-
*
|
|
8276
|
-
* ES7 syntax:
|
|
8274
|
+
* An interface implemented by all Angular type decorators, which allows them to be used as
|
|
8275
|
+
* decorators as well as Angular syntax.
|
|
8277
8276
|
*
|
|
8278
8277
|
* ```
|
|
8279
8278
|
* @ng.Component({...})
|
|
@@ -8284,7 +8283,7 @@ export declare interface Type<T> extends Function {
|
|
|
8284
8283
|
*/
|
|
8285
8284
|
export declare interface TypeDecorator {
|
|
8286
8285
|
/**
|
|
8287
|
-
* Invoke as
|
|
8286
|
+
* Invoke as decorator.
|
|
8288
8287
|
*/
|
|
8289
8288
|
<T extends Type<any>>(type: T): T;
|
|
8290
8289
|
(target: Object, propertyKey?: string | symbol, parameterIndex?: number): void;
|
|
@@ -8299,9 +8298,8 @@ export declare interface TypeDecorator {
|
|
|
8299
8298
|
* For more details, see the ["Dependency Injection Guide"](guide/dependency-injection).
|
|
8300
8299
|
*
|
|
8301
8300
|
* @usageNotes
|
|
8302
|
-
* ### Example
|
|
8303
8301
|
*
|
|
8304
|
-
* {@example core/di/ts/provider_spec.ts region='TypeProvider'}
|
|
8302
|
+
* {@example core/di/ts/provider_spec.ts region='TypeProvider' linenums="false"}
|
|
8305
8303
|
*
|
|
8306
8304
|
* @publicApi
|
|
8307
8305
|
*/
|
|
@@ -8310,27 +8308,27 @@ export declare interface TypeProvider extends Type<any> {
|
|
|
8310
8308
|
|
|
8311
8309
|
/**
|
|
8312
8310
|
* Configures the `Injector` to return a value for a token.
|
|
8313
|
-
*
|
|
8314
|
-
* For more details, see the ["Dependency Injection Guide"](guide/dependency-injection).
|
|
8311
|
+
* @see ["Dependency Injection Guide"](guide/dependency-injection).
|
|
8315
8312
|
*
|
|
8316
8313
|
* @usageNotes
|
|
8314
|
+
*
|
|
8317
8315
|
* ### Example
|
|
8318
8316
|
*
|
|
8319
|
-
* {@example core/di/ts/provider_spec.ts region='ValueProvider'}
|
|
8317
|
+
* {@example core/di/ts/provider_spec.ts region='ValueProvider' linenums="false"}
|
|
8320
8318
|
*
|
|
8321
8319
|
* ### Multi-value example
|
|
8322
8320
|
*
|
|
8323
|
-
* {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
|
|
8321
|
+
* {@example core/di/ts/provider_spec.ts region='MultiProviderAspect' linenums="false"}
|
|
8324
8322
|
*
|
|
8325
8323
|
* @publicApi
|
|
8326
8324
|
*/
|
|
8327
8325
|
export declare interface ValueProvider extends ValueSansProvider {
|
|
8328
8326
|
/**
|
|
8329
|
-
* An injection token.
|
|
8327
|
+
* An injection token. Typically an instance of `Type` or `InjectionToken`, but can be `any`.
|
|
8330
8328
|
*/
|
|
8331
8329
|
provide: any;
|
|
8332
8330
|
/**
|
|
8333
|
-
*
|
|
8331
|
+
* When true, injector returns an array of instances. This is useful to allow multiple
|
|
8334
8332
|
* providers spread across many files to provide configuration information to a common token.
|
|
8335
8333
|
*/
|
|
8336
8334
|
multi?: boolean;
|
|
@@ -8338,17 +8336,11 @@ export declare interface ValueProvider extends ValueSansProvider {
|
|
|
8338
8336
|
|
|
8339
8337
|
/**
|
|
8340
8338
|
* Configures the `Injector` to return a value for a token.
|
|
8341
|
-
*
|
|
8342
|
-
* For more details, see the ["Dependency Injection Guide"](guide/dependency-injection).
|
|
8343
|
-
*
|
|
8344
|
-
* @usageNotes
|
|
8345
|
-
* ### Example
|
|
8346
|
-
*
|
|
8347
|
-
* {@example core/di/ts/provider_spec.ts region='ValueSansProvider'}
|
|
8339
|
+
* Base for `ValueProvider` decorator.
|
|
8348
8340
|
*
|
|
8349
8341
|
* @publicApi
|
|
8350
8342
|
*/
|
|
8351
|
-
declare interface ValueSansProvider {
|
|
8343
|
+
export declare interface ValueSansProvider {
|
|
8352
8344
|
/**
|
|
8353
8345
|
* The value to inject.
|
|
8354
8346
|
*/
|
|
@@ -8374,6 +8366,8 @@ export declare class Version {
|
|
|
8374
8366
|
constructor(full: string);
|
|
8375
8367
|
}
|
|
8376
8368
|
|
|
8369
|
+
declare const VIEW_REFS = 8;
|
|
8370
|
+
|
|
8377
8371
|
/**
|
|
8378
8372
|
* Type of the ViewChild metadata.
|
|
8379
8373
|
*
|
|
@@ -8407,37 +8401,35 @@ export declare interface ViewChildDecorator {
|
|
|
8407
8401
|
*
|
|
8408
8402
|
* **Metadata Properties**:
|
|
8409
8403
|
*
|
|
8410
|
-
* * **selector** -
|
|
8411
|
-
* * **read** - read a different token from the queried elements.
|
|
8412
|
-
* * **static** -
|
|
8413
|
-
*
|
|
8414
|
-
*
|
|
8415
|
-
* resolution. If any query results are inside a nested view (
|
|
8416
|
-
* resolved after change detection runs. Otherwise, it
|
|
8404
|
+
* * **selector** - The directive type or the name used for querying.
|
|
8405
|
+
* * **read** - True to read a different token from the queried elements.
|
|
8406
|
+
* * **static** - True to resolve query results before change detection runs
|
|
8407
|
+
*
|
|
8408
|
+
* When `static` is not provided, uses query results to determine the timing of query
|
|
8409
|
+
* resolution. If any query results are inside a nested view (such as `*ngIf`), the query is
|
|
8410
|
+
* resolved after change detection runs. Otherwise, it is resolved before change detection
|
|
8417
8411
|
* runs.
|
|
8418
8412
|
*
|
|
8419
|
-
*
|
|
8420
|
-
* *
|
|
8421
|
-
* *
|
|
8413
|
+
* The following selectors are supported.
|
|
8414
|
+
* * Any class with the `@Component` or `@Directive` decorator
|
|
8415
|
+
* * A template reference variable as a string (e.g. query `<my-component #cmp></my-component>`
|
|
8422
8416
|
* with `@ViewChild('cmp')`)
|
|
8423
|
-
* *
|
|
8417
|
+
* * Any provider defined in the child component tree of the current component (e.g.
|
|
8424
8418
|
* `@ViewChild(SomeService) someService: SomeService`)
|
|
8425
|
-
* *
|
|
8419
|
+
* * Any provider defined through a string token (e.g. `@ViewChild('someToken') someTokenVal:
|
|
8426
8420
|
* any`)
|
|
8427
|
-
* *
|
|
8421
|
+
* * A `TemplateRef` (e.g. query `<ng-template></ng-template>` with `@ViewChild(TemplateRef)
|
|
8428
8422
|
* template;`)
|
|
8429
8423
|
*
|
|
8430
8424
|
* @usageNotes
|
|
8431
8425
|
*
|
|
8432
|
-
* {@example core/di/ts/viewChild/view_child_example.ts region='Component'
|
|
8426
|
+
* {@example core/di/ts/viewChild/view_child_example.ts region='Component'
|
|
8427
|
+
* linenums="false"}
|
|
8433
8428
|
*
|
|
8434
|
-
* ### Example
|
|
8429
|
+
* ### Example 2
|
|
8435
8430
|
*
|
|
8436
|
-
* {@example core/di/ts/viewChild/view_child_howto.ts region='HowTo'
|
|
8437
|
-
*
|
|
8438
|
-
* ### Example
|
|
8439
|
-
*
|
|
8440
|
-
* {@example core/di/ts/viewChild/view_child_example.ts region='Component'}
|
|
8431
|
+
* {@example core/di/ts/viewChild/view_child_howto.ts region='HowTo'
|
|
8432
|
+
* linenums="false"}
|
|
8441
8433
|
*
|
|
8442
8434
|
* @Annotation
|
|
8443
8435
|
*/
|
|
@@ -8475,28 +8467,28 @@ export declare const ViewChildren: ViewChildrenDecorator;
|
|
|
8475
8467
|
*/
|
|
8476
8468
|
export declare interface ViewChildrenDecorator {
|
|
8477
8469
|
/**
|
|
8478
|
-
*
|
|
8470
|
+
* Parameter decorator that configures a view query.
|
|
8479
8471
|
*
|
|
8480
|
-
*
|
|
8481
|
-
*
|
|
8472
|
+
* Use to get the `QueryList` of elements or directives from the view DOM.
|
|
8473
|
+
* Any time a child element is added, removed, or moved, the query list will be updated,
|
|
8482
8474
|
* and the changes observable of the query list will emit a new value.
|
|
8483
8475
|
*
|
|
8484
8476
|
* View queries are set before the `ngAfterViewInit` callback is called.
|
|
8485
8477
|
*
|
|
8486
8478
|
* **Metadata Properties**:
|
|
8487
8479
|
*
|
|
8488
|
-
* * **selector** -
|
|
8489
|
-
* * **read** - read a different token from the queried elements.
|
|
8480
|
+
* * **selector** - The directive type or the name used for querying.
|
|
8481
|
+
* * **read** - True to read a different token from the queried elements.
|
|
8490
8482
|
*
|
|
8491
8483
|
* @usageNotes
|
|
8492
8484
|
*
|
|
8493
|
-
*
|
|
8485
|
+
* {@example core/di/ts/viewChildren/view_children_howto.ts region='HowTo'
|
|
8486
|
+
* linenums="false"}
|
|
8494
8487
|
*
|
|
8495
|
-
*
|
|
8488
|
+
* ### Another example
|
|
8496
8489
|
*
|
|
8497
|
-
*
|
|
8498
|
-
*
|
|
8499
|
-
* {@example core/di/ts/viewChildren/view_children_example.ts region='Component'}
|
|
8490
|
+
* {@example core/di/ts/viewChildren/view_children_example.ts region='Component'
|
|
8491
|
+
* linenums="false"}
|
|
8500
8492
|
*
|
|
8501
8493
|
* @Annotation
|
|
8502
8494
|
*/
|
|
@@ -11064,7 +11056,7 @@ export declare function ɵɵallocHostVars(count: number): void;
|
|
|
11064
11056
|
*
|
|
11065
11057
|
* @codeGenApi
|
|
11066
11058
|
*/
|
|
11067
|
-
export declare function ɵɵattribute(name: string, value: any, sanitizer?: SanitizerFn | null, namespace?: string):
|
|
11059
|
+
export declare function ɵɵattribute(name: string, value: any, sanitizer?: SanitizerFn | null, namespace?: string): TsickleIssue1009;
|
|
11068
11060
|
|
|
11069
11061
|
/**
|
|
11070
11062
|
*
|
|
@@ -11415,15 +11407,6 @@ export declare interface ɵɵBaseDef<T> {
|
|
|
11415
11407
|
hostBindings: HostBindingsFunction<T> | null;
|
|
11416
11408
|
}
|
|
11417
11409
|
|
|
11418
|
-
/**
|
|
11419
|
-
* Creates a single value binding.
|
|
11420
|
-
*
|
|
11421
|
-
* @param value Value to diff
|
|
11422
|
-
*
|
|
11423
|
-
* @codeGenApi
|
|
11424
|
-
*/
|
|
11425
|
-
export declare function ɵɵbind<T>(value: T): T | ɵNO_CHANGE;
|
|
11426
|
-
|
|
11427
11410
|
/**
|
|
11428
11411
|
* Update class bindings using an object literal or class-string on an element.
|
|
11429
11412
|
*
|
|
@@ -12335,10 +12318,12 @@ export declare function ɵɵi18nEnd(): void;
|
|
|
12335
12318
|
* update the translated nodes.
|
|
12336
12319
|
*
|
|
12337
12320
|
* @param value The binding's value
|
|
12321
|
+
* @returns This function returns itself so that it may be chained
|
|
12322
|
+
* (e.g. `i18nExp(ctx.name)(ctx.title)`)
|
|
12338
12323
|
*
|
|
12339
12324
|
* @codeGenApi
|
|
12340
12325
|
*/
|
|
12341
|
-
export declare function ɵɵi18nExp<T>(value: T):
|
|
12326
|
+
export declare function ɵɵi18nExp<T>(value: T): TsickleIssue1009;
|
|
12342
12327
|
|
|
12343
12328
|
/**
|
|
12344
12329
|
* A goog.getMsg-like function for users that do not use Closure.
|