@angular/core 8.1.0-next.2 → 8.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/core-testing.umd.js +1 -1
- package/bundles/core-testing.umd.js.map +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 +394 -279
- package/bundles/core.umd.js.map +1 -1
- package/bundles/core.umd.min.js +101 -101
- package/bundles/core.umd.min.js.map +1 -1
- package/core.d.ts +221 -234
- 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 +18 -13
- package/esm2015/src/render3/di.js +4 -6
- package/esm2015/src/render3/features/providers_feature.js +6 -3
- package/esm2015/src/render3/i18n.js +20 -13
- 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 +36 -5
- package/esm2015/src/render3/instructions/text.js +15 -20
- package/esm2015/src/render3/instructions/text_interpolation.js +67 -12
- 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 +235 -197
- package/esm2015/src/render3/query.js +12 -8
- package/esm2015/src/render3/state.js +6 -3
- package/esm2015/src/render3/util/misc_utils.js +1 -1
- 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/esm2015/testing/src/test_bed_common.js +5 -2
- 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 +13 -9
- package/esm5/src/render3/di.js +4 -5
- package/esm5/src/render3/features/providers_feature.js +6 -3
- package/esm5/src/render3/i18n.js +15 -10
- 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 +27 -5
- package/esm5/src/render3/instructions/text.js +12 -17
- package/esm5/src/render3/instructions/text_interpolation.js +49 -12
- 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 +200 -192
- package/esm5/src/render3/query.js +10 -8
- package/esm5/src/render3/state.js +6 -3
- package/esm5/src/render3/util/misc_utils.js +1 -1
- 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/esm5/testing/src/test_bed_common.js +1 -1
- package/fesm2015/core.js +483 -296
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/testing.js +1 -1
- package/fesm2015/testing.js.map +1 -1
- package/fesm5/core.js +395 -279
- package/fesm5/core.js.map +1 -1
- package/fesm5/testing.js +1 -1
- package/fesm5/testing.js.map +1 -1
- package/package.json +1 -1
- package/src/r3_symbols.d.ts +73 -90
- package/testing/testing.d.ts +5 -2
- 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.1
|
|
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,7 +3148,7 @@ 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 `Injector` for creation.
|
|
3149
3152
|
*
|
|
3150
3153
|
* @see [Introduction to Services and DI](guide/architecture-services)
|
|
3151
3154
|
* @see [Dependency Injection Guide](guide/dependency-injection)
|
|
@@ -3155,7 +3158,8 @@ export declare interface InjectableDecorator {
|
|
|
3155
3158
|
* The following example shows how service classes are properly marked as
|
|
3156
3159
|
* injectable.
|
|
3157
3160
|
*
|
|
3158
|
-
* <code-example path="core/di/ts/metadata_spec.ts" region="Injectable"
|
|
3161
|
+
* <code-example path="core/di/ts/metadata_spec.ts" region="Injectable"
|
|
3162
|
+
* linenums="false"></code-example>
|
|
3159
3163
|
*
|
|
3160
3164
|
*/
|
|
3161
3165
|
(): TypeDecorator;
|
|
@@ -3201,7 +3205,7 @@ declare function injectChangeDetectorRef(): ChangeDetectorRef;
|
|
|
3201
3205
|
*/
|
|
3202
3206
|
export declare interface InjectDecorator {
|
|
3203
3207
|
/**
|
|
3204
|
-
*
|
|
3208
|
+
* Parameter decorator on a dependency parameter of a class constructor
|
|
3205
3209
|
* that specifies a custom provider of the dependency.
|
|
3206
3210
|
*
|
|
3207
3211
|
* Learn more in the ["Dependency Injection Guide"](guide/dependency-injection).
|
|
@@ -3214,7 +3218,7 @@ export declare interface InjectDecorator {
|
|
|
3214
3218
|
* parameter as the provider.
|
|
3215
3219
|
*
|
|
3216
3220
|
* <code-example path="core/di/ts/metadata_spec.ts"
|
|
3217
|
-
* region="InjectWithoutDecorator"></code-example>
|
|
3221
|
+
* region="InjectWithoutDecorator" linenums="false"></code-example>
|
|
3218
3222
|
*/
|
|
3219
3223
|
(token: any): any;
|
|
3220
3224
|
new (token: any): Inject;
|
|
@@ -3381,7 +3385,7 @@ declare interface InjectorTypeWithProviders<T> {
|
|
|
3381
3385
|
providers?: (Type<any> | ValueProvider | ExistingProvider | FactoryProvider | ConstructorProvider | StaticClassProvider | ClassProvider | any[])[];
|
|
3382
3386
|
}
|
|
3383
3387
|
|
|
3384
|
-
/**
|
|
3388
|
+
/** Injects a Renderer2 for the current component. */
|
|
3385
3389
|
declare function injectRenderer2(): Renderer2;
|
|
3386
3390
|
|
|
3387
3391
|
/**
|
|
@@ -3806,6 +3810,12 @@ declare interface LContainer extends Array<any> {
|
|
|
3806
3810
|
[T_HOST]: TNode;
|
|
3807
3811
|
/** The comment element that serves as an anchor for this LContainer. */
|
|
3808
3812
|
readonly [NATIVE]: RComment;
|
|
3813
|
+
/**
|
|
3814
|
+
* Array of `ViewRef`s used by any `ViewContainerRef`s that point to this container.
|
|
3815
|
+
*
|
|
3816
|
+
* This is lazily initialized by `ViewContainerRef` when the first view is inserted.
|
|
3817
|
+
*/
|
|
3818
|
+
[VIEW_REFS]: ViewRef[] | null;
|
|
3809
3819
|
}
|
|
3810
3820
|
|
|
3811
3821
|
/**
|
|
@@ -4797,7 +4807,7 @@ export declare const Optional: OptionalDecorator;
|
|
|
4797
4807
|
*/
|
|
4798
4808
|
export declare interface OptionalDecorator {
|
|
4799
4809
|
/**
|
|
4800
|
-
*
|
|
4810
|
+
* Parameter decorator to be used on constructor parameters,
|
|
4801
4811
|
* which marks the parameter as being an optional dependency.
|
|
4802
4812
|
* The DI framework provides null if the dependency is not found.
|
|
4803
4813
|
*
|
|
@@ -4810,7 +4820,8 @@ export declare interface OptionalDecorator {
|
|
|
4810
4820
|
*
|
|
4811
4821
|
* The following code allows the possibility of a null result:
|
|
4812
4822
|
*
|
|
4813
|
-
* <code-example path="core/di/ts/metadata_spec.ts" region="Optional"
|
|
4823
|
+
* <code-example path="core/di/ts/metadata_spec.ts" region="Optional"
|
|
4824
|
+
* linenums="false"></code-example>
|
|
4814
4825
|
*
|
|
4815
4826
|
*/
|
|
4816
4827
|
(): any;
|
|
@@ -4952,17 +4963,15 @@ declare type PipeDefListOrFactory = (() => PipeDefList) | PipeDefList;
|
|
|
4952
4963
|
|
|
4953
4964
|
|
|
4954
4965
|
/**
|
|
4955
|
-
*
|
|
4956
|
-
*
|
|
4966
|
+
* An interface that is implemented by pipes in order to perform a transformation.
|
|
4957
4967
|
* Angular invokes the `transform` method with the value of a binding
|
|
4958
4968
|
* as the first argument, and any parameters as the second argument in list form.
|
|
4959
4969
|
*
|
|
4960
4970
|
* @usageNotes
|
|
4961
|
-
* ### Example
|
|
4962
4971
|
*
|
|
4963
|
-
*
|
|
4972
|
+
* In the following example, `RepeatPipe` repeats a given value a given number of times.
|
|
4964
4973
|
*
|
|
4965
|
-
* ```
|
|
4974
|
+
* ```ts
|
|
4966
4975
|
* import {Pipe, PipeTransform} from '@angular/core';
|
|
4967
4976
|
*
|
|
4968
4977
|
* @Pipe({name: 'repeat'})
|
|
@@ -5192,7 +5201,7 @@ declare interface ProceduralRenderer3 {
|
|
|
5192
5201
|
}
|
|
5193
5202
|
|
|
5194
5203
|
/**
|
|
5195
|
-
* Describes a function that is used to process provider
|
|
5204
|
+
* Describes a function that is used to process provider lists (such as provider
|
|
5196
5205
|
* overrides).
|
|
5197
5206
|
*/
|
|
5198
5207
|
declare type ProcessProvidersFunction = (providers: Provider[]) => Provider[];
|
|
@@ -5234,11 +5243,8 @@ declare type PropertyAliasValue = (number | string)[];
|
|
|
5234
5243
|
|
|
5235
5244
|
/**
|
|
5236
5245
|
* Describes how the `Injector` should be configured.
|
|
5246
|
+
* @see ["Dependency Injection Guide"](guide/dependency-injection).
|
|
5237
5247
|
*
|
|
5238
|
-
* For more details, see the ["Dependency Injection Guide"](guide/dependency-injection).
|
|
5239
|
-
*
|
|
5240
|
-
* @see `TypeProvider`
|
|
5241
|
-
* @see `ClassProvider`
|
|
5242
5248
|
* @see `StaticProvider`
|
|
5243
5249
|
*
|
|
5244
5250
|
* @publicApi
|
|
@@ -6331,7 +6337,7 @@ export declare const Self: SelfDecorator;
|
|
|
6331
6337
|
*/
|
|
6332
6338
|
export declare interface SelfDecorator {
|
|
6333
6339
|
/**
|
|
6334
|
-
*
|
|
6340
|
+
* Parameter decorator to be used on constructor parameters,
|
|
6335
6341
|
* which tells the DI framework to start dependency resolution from the local injector.
|
|
6336
6342
|
*
|
|
6337
6343
|
* Resolution works upward through the injector hierarchy, so the children
|
|
@@ -6343,7 +6349,8 @@ export declare interface SelfDecorator {
|
|
|
6343
6349
|
* by the local injector when instantiating the class itself, but not
|
|
6344
6350
|
* when instantiating a child.
|
|
6345
6351
|
*
|
|
6346
|
-
* <code-example path="core/di/ts/metadata_spec.ts" region="Self"
|
|
6352
|
+
* <code-example path="core/di/ts/metadata_spec.ts" region="Self"
|
|
6353
|
+
* linenums="false"></code-example>
|
|
6347
6354
|
*
|
|
6348
6355
|
*
|
|
6349
6356
|
* @see `SkipSelf`
|
|
@@ -6455,7 +6462,7 @@ export declare const SkipSelf: SkipSelfDecorator;
|
|
|
6455
6462
|
*/
|
|
6456
6463
|
export declare interface SkipSelfDecorator {
|
|
6457
6464
|
/**
|
|
6458
|
-
*
|
|
6465
|
+
* Parameter decorator to be used on constructor parameters,
|
|
6459
6466
|
* which tells the DI framework to start dependency resolution from the parent injector.
|
|
6460
6467
|
* Resolution works upward through the injector hierarchy, so the local injector
|
|
6461
6468
|
* is not checked for a provider.
|
|
@@ -6465,7 +6472,8 @@ export declare interface SkipSelfDecorator {
|
|
|
6465
6472
|
* In the following example, the dependency can be resolved when
|
|
6466
6473
|
* instantiating a child, but not when instantiating the class itself.
|
|
6467
6474
|
*
|
|
6468
|
-
* <code-example path="core/di/ts/metadata_spec.ts" region="SkipSelf"
|
|
6475
|
+
* <code-example path="core/di/ts/metadata_spec.ts" region="SkipSelf"
|
|
6476
|
+
* linenums="false"></code-example>
|
|
6469
6477
|
*
|
|
6470
6478
|
* Learn more in the
|
|
6471
6479
|
* [Dependency Injection guide](guide/dependency-injection-in-action#skip).
|
|
@@ -6480,29 +6488,29 @@ export declare interface SkipSelfDecorator {
|
|
|
6480
6488
|
|
|
6481
6489
|
/**
|
|
6482
6490
|
* 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).
|
|
6491
|
+
* @see ["Dependency Injection Guide"](guide/dependency-injection).
|
|
6485
6492
|
*
|
|
6486
6493
|
* @usageNotes
|
|
6487
|
-
* ### Example
|
|
6488
6494
|
*
|
|
6489
6495
|
* {@example core/di/ts/provider_spec.ts region='StaticClassProvider'}
|
|
6490
6496
|
*
|
|
6491
6497
|
* Note that following two providers are not equal:
|
|
6492
6498
|
*
|
|
6493
|
-
* {@example core/di/ts/provider_spec.ts region='StaticClassProviderDifference'}
|
|
6499
|
+
* {@example core/di/ts/provider_spec.ts region='StaticClassProviderDifference' linenums="false"}
|
|
6494
6500
|
*
|
|
6495
6501
|
* ### Multi-value example
|
|
6496
6502
|
*
|
|
6497
|
-
* {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
|
|
6503
|
+
* {@example core/di/ts/provider_spec.ts region='MultiProviderAspect' linenums="false"}
|
|
6504
|
+
*
|
|
6505
|
+
* @publicApi
|
|
6498
6506
|
*/
|
|
6499
|
-
declare interface StaticClassProvider extends StaticClassSansProvider {
|
|
6507
|
+
export declare interface StaticClassProvider extends StaticClassSansProvider {
|
|
6500
6508
|
/**
|
|
6501
|
-
* An injection token.
|
|
6509
|
+
* An injection token. Typically an instance of `Type` or `InjectionToken`, but can be `any`.
|
|
6502
6510
|
*/
|
|
6503
6511
|
provide: any;
|
|
6504
6512
|
/**
|
|
6505
|
-
*
|
|
6513
|
+
* When true, injector returns an array of instances. This is useful to allow multiple
|
|
6506
6514
|
* providers spread across many files to provide configuration information to a common token.
|
|
6507
6515
|
*/
|
|
6508
6516
|
multi?: boolean;
|
|
@@ -6510,37 +6518,26 @@ declare interface StaticClassProvider extends StaticClassSansProvider {
|
|
|
6510
6518
|
|
|
6511
6519
|
/**
|
|
6512
6520
|
* 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'}
|
|
6521
|
+
* Base for `StaticClassProvider` decorator.
|
|
6520
6522
|
*
|
|
6521
6523
|
* @publicApi
|
|
6522
6524
|
*/
|
|
6523
|
-
declare interface StaticClassSansProvider {
|
|
6525
|
+
export declare interface StaticClassSansProvider {
|
|
6524
6526
|
/**
|
|
6525
|
-
* An optional class to instantiate for the `token`.
|
|
6526
|
-
* class
|
|
6527
|
+
* An optional class to instantiate for the `token`. By default, the `provide`
|
|
6528
|
+
* class is instantiated.
|
|
6527
6529
|
*/
|
|
6528
6530
|
useClass: Type<any>;
|
|
6529
6531
|
/**
|
|
6530
|
-
* A list of `token`s
|
|
6532
|
+
* A list of `token`s to be resolved by the injector. The list of values is then
|
|
6531
6533
|
* used as arguments to the `useClass` constructor.
|
|
6532
6534
|
*/
|
|
6533
6535
|
deps: any[];
|
|
6534
6536
|
}
|
|
6535
6537
|
|
|
6536
6538
|
/**
|
|
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`
|
|
6539
|
+
* Describes how the `Injector` should be configured as static (that is, without reflection).
|
|
6540
|
+
* @see ["Dependency Injection Guide"](guide/dependency-injection).
|
|
6544
6541
|
*
|
|
6545
6542
|
* @publicApi
|
|
6546
6543
|
*/
|
|
@@ -7470,7 +7467,7 @@ declare interface TNode {
|
|
|
7470
7467
|
* - This would return the first head node to project:
|
|
7471
7468
|
* `getHost(currentTNode).projection[currentTNode.projection]`.
|
|
7472
7469
|
* - When projecting nodes the parent node retrieved may be a `<ng-content>` node, in which case
|
|
7473
|
-
* the process is recursive in nature
|
|
7470
|
+
* the process is recursive in nature.
|
|
7474
7471
|
*
|
|
7475
7472
|
* If `projection` is of type `RNode[][]` than we have a collection of native nodes passed as
|
|
7476
7473
|
* projectable nodes during dynamic component creation.
|
|
@@ -8049,7 +8046,7 @@ declare interface TView {
|
|
|
8049
8046
|
*/
|
|
8050
8047
|
viewQuery: ViewQueriesFunction<{}> | null;
|
|
8051
8048
|
/**
|
|
8052
|
-
* Pointer to the `TNode`
|
|
8049
|
+
* Pointer to the host `TNode` (not part of this TView).
|
|
8053
8050
|
*
|
|
8054
8051
|
* If this is a `TViewNode` for an `LViewNode`, this is an embedded view of a container.
|
|
8055
8052
|
* We need this pointer to be able to efficiently find this node when inserting the view
|
|
@@ -8269,11 +8266,8 @@ export declare interface Type<T> extends Function {
|
|
|
8269
8266
|
}
|
|
8270
8267
|
|
|
8271
8268
|
/**
|
|
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:
|
|
8269
|
+
* An interface implemented by all Angular type decorators, which allows them to be used as
|
|
8270
|
+
* decorators as well as Angular syntax.
|
|
8277
8271
|
*
|
|
8278
8272
|
* ```
|
|
8279
8273
|
* @ng.Component({...})
|
|
@@ -8284,7 +8278,7 @@ export declare interface Type<T> extends Function {
|
|
|
8284
8278
|
*/
|
|
8285
8279
|
export declare interface TypeDecorator {
|
|
8286
8280
|
/**
|
|
8287
|
-
* Invoke as
|
|
8281
|
+
* Invoke as decorator.
|
|
8288
8282
|
*/
|
|
8289
8283
|
<T extends Type<any>>(type: T): T;
|
|
8290
8284
|
(target: Object, propertyKey?: string | symbol, parameterIndex?: number): void;
|
|
@@ -8299,9 +8293,8 @@ export declare interface TypeDecorator {
|
|
|
8299
8293
|
* For more details, see the ["Dependency Injection Guide"](guide/dependency-injection).
|
|
8300
8294
|
*
|
|
8301
8295
|
* @usageNotes
|
|
8302
|
-
* ### Example
|
|
8303
8296
|
*
|
|
8304
|
-
* {@example core/di/ts/provider_spec.ts region='TypeProvider'}
|
|
8297
|
+
* {@example core/di/ts/provider_spec.ts region='TypeProvider' linenums="false"}
|
|
8305
8298
|
*
|
|
8306
8299
|
* @publicApi
|
|
8307
8300
|
*/
|
|
@@ -8310,27 +8303,27 @@ export declare interface TypeProvider extends Type<any> {
|
|
|
8310
8303
|
|
|
8311
8304
|
/**
|
|
8312
8305
|
* Configures the `Injector` to return a value for a token.
|
|
8313
|
-
*
|
|
8314
|
-
* For more details, see the ["Dependency Injection Guide"](guide/dependency-injection).
|
|
8306
|
+
* @see ["Dependency Injection Guide"](guide/dependency-injection).
|
|
8315
8307
|
*
|
|
8316
8308
|
* @usageNotes
|
|
8309
|
+
*
|
|
8317
8310
|
* ### Example
|
|
8318
8311
|
*
|
|
8319
|
-
* {@example core/di/ts/provider_spec.ts region='ValueProvider'}
|
|
8312
|
+
* {@example core/di/ts/provider_spec.ts region='ValueProvider' linenums="false"}
|
|
8320
8313
|
*
|
|
8321
8314
|
* ### Multi-value example
|
|
8322
8315
|
*
|
|
8323
|
-
* {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
|
|
8316
|
+
* {@example core/di/ts/provider_spec.ts region='MultiProviderAspect' linenums="false"}
|
|
8324
8317
|
*
|
|
8325
8318
|
* @publicApi
|
|
8326
8319
|
*/
|
|
8327
8320
|
export declare interface ValueProvider extends ValueSansProvider {
|
|
8328
8321
|
/**
|
|
8329
|
-
* An injection token.
|
|
8322
|
+
* An injection token. Typically an instance of `Type` or `InjectionToken`, but can be `any`.
|
|
8330
8323
|
*/
|
|
8331
8324
|
provide: any;
|
|
8332
8325
|
/**
|
|
8333
|
-
*
|
|
8326
|
+
* When true, injector returns an array of instances. This is useful to allow multiple
|
|
8334
8327
|
* providers spread across many files to provide configuration information to a common token.
|
|
8335
8328
|
*/
|
|
8336
8329
|
multi?: boolean;
|
|
@@ -8338,17 +8331,11 @@ export declare interface ValueProvider extends ValueSansProvider {
|
|
|
8338
8331
|
|
|
8339
8332
|
/**
|
|
8340
8333
|
* 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'}
|
|
8334
|
+
* Base for `ValueProvider` decorator.
|
|
8348
8335
|
*
|
|
8349
8336
|
* @publicApi
|
|
8350
8337
|
*/
|
|
8351
|
-
declare interface ValueSansProvider {
|
|
8338
|
+
export declare interface ValueSansProvider {
|
|
8352
8339
|
/**
|
|
8353
8340
|
* The value to inject.
|
|
8354
8341
|
*/
|
|
@@ -8374,6 +8361,8 @@ export declare class Version {
|
|
|
8374
8361
|
constructor(full: string);
|
|
8375
8362
|
}
|
|
8376
8363
|
|
|
8364
|
+
declare const VIEW_REFS = 8;
|
|
8365
|
+
|
|
8377
8366
|
/**
|
|
8378
8367
|
* Type of the ViewChild metadata.
|
|
8379
8368
|
*
|
|
@@ -8407,37 +8396,40 @@ export declare interface ViewChildDecorator {
|
|
|
8407
8396
|
*
|
|
8408
8397
|
* **Metadata Properties**:
|
|
8409
8398
|
*
|
|
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
|
|
8399
|
+
* * **selector** - The directive type or the name used for querying.
|
|
8400
|
+
* * **read** - True to read a different token from the queried elements.
|
|
8401
|
+
* * **static** - True to resolve query results before change detection runs
|
|
8402
|
+
*
|
|
8403
|
+
* When `static` is not provided, uses query results to determine the timing of query
|
|
8404
|
+
* resolution. If any query results are inside a nested view (such as `*ngIf`), the query is
|
|
8405
|
+
* resolved after change detection runs. Otherwise, it is resolved before change detection
|
|
8417
8406
|
* runs.
|
|
8418
8407
|
*
|
|
8419
|
-
*
|
|
8420
|
-
* *
|
|
8421
|
-
* *
|
|
8408
|
+
* The following selectors are supported.
|
|
8409
|
+
* * Any class with the `@Component` or `@Directive` decorator
|
|
8410
|
+
* * A template reference variable as a string (e.g. query `<my-component #cmp></my-component>`
|
|
8422
8411
|
* with `@ViewChild('cmp')`)
|
|
8423
|
-
* *
|
|
8412
|
+
* * Any provider defined in the child component tree of the current component (e.g.
|
|
8424
8413
|
* `@ViewChild(SomeService) someService: SomeService`)
|
|
8425
|
-
* *
|
|
8414
|
+
* * Any provider defined through a string token (e.g. `@ViewChild('someToken') someTokenVal:
|
|
8426
8415
|
* any`)
|
|
8427
|
-
* *
|
|
8416
|
+
* * A `TemplateRef` (e.g. query `<ng-template></ng-template>` with `@ViewChild(TemplateRef)
|
|
8428
8417
|
* template;`)
|
|
8429
8418
|
*
|
|
8430
8419
|
* @usageNotes
|
|
8431
8420
|
*
|
|
8432
|
-
* {@example core/di/ts/viewChild/view_child_example.ts region='Component'
|
|
8421
|
+
* {@example core/di/ts/viewChild/view_child_example.ts region='Component'
|
|
8422
|
+
* linenums="false"}
|
|
8433
8423
|
*
|
|
8434
|
-
* ### Example
|
|
8424
|
+
* ### Example 2
|
|
8435
8425
|
*
|
|
8436
|
-
* {@example core/di/ts/viewChild/view_child_howto.ts region='HowTo'
|
|
8426
|
+
* {@example core/di/ts/viewChild/view_child_howto.ts region='HowTo'
|
|
8427
|
+
* linenums="false"}
|
|
8437
8428
|
*
|
|
8438
|
-
* ### Example
|
|
8429
|
+
* ### Example 3
|
|
8439
8430
|
*
|
|
8440
|
-
* {@example core/di/ts/viewChild/view_child_example.ts region='Component'
|
|
8431
|
+
* {@example core/di/ts/viewChild/view_child_example.ts region='Component'
|
|
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
|
-
*
|
|
8494
|
-
*
|
|
8495
|
-
* {@example core/di/ts/viewChildren/view_children_howto.ts region='HowTo'}
|
|
8485
|
+
* {@example core/di/ts/viewChildren/view_children_howto.ts region='HowTo'
|
|
8486
|
+
* linenums="false"}
|
|
8496
8487
|
*
|
|
8497
|
-
* ###
|
|
8488
|
+
* ### Another example
|
|
8498
8489
|
*
|
|
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
|
*
|
|
@@ -12334,11 +12317,13 @@ export declare function ɵɵi18nEnd(): void;
|
|
|
12334
12317
|
* Stores the values of the bindings during each update cycle in order to determine if we need to
|
|
12335
12318
|
* update the translated nodes.
|
|
12336
12319
|
*
|
|
12337
|
-
* @param
|
|
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>(
|
|
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.
|
|
@@ -13198,6 +13183,7 @@ export declare function ɵɵpropertyInterpolateV(propName: string, values: any[]
|
|
|
13198
13183
|
* and publish them into the DI system, making it visible to others for injection.
|
|
13199
13184
|
*
|
|
13200
13185
|
* For example:
|
|
13186
|
+
* ```ts
|
|
13201
13187
|
* class ComponentWithProviders {
|
|
13202
13188
|
* constructor(private greeter: GreeterDE) {}
|
|
13203
13189
|
*
|
|
@@ -13209,15 +13195,17 @@ export declare function ɵɵpropertyInterpolateV(propName: string, values: any[]
|
|
|
13209
13195
|
* vars: 1,
|
|
13210
13196
|
* template: function(fs: RenderFlags, ctx: ComponentWithProviders) {
|
|
13211
13197
|
* if (fs & RenderFlags.Create) {
|
|
13212
|
-
*
|
|
13198
|
+
* ɵɵtext(0);
|
|
13213
13199
|
* }
|
|
13214
13200
|
* if (fs & RenderFlags.Update) {
|
|
13215
|
-
*
|
|
13201
|
+
* ɵɵselect(0);
|
|
13202
|
+
* ɵɵtextBinding(ctx.greeter.greet());
|
|
13216
13203
|
* }
|
|
13217
13204
|
* },
|
|
13218
13205
|
* features: [ProvidersFeature([GreeterDE])]
|
|
13219
13206
|
* });
|
|
13220
13207
|
* }
|
|
13208
|
+
* ```
|
|
13221
13209
|
*
|
|
13222
13210
|
* @param definition
|
|
13223
13211
|
*
|
|
@@ -13781,12 +13769,11 @@ export declare function ɵɵtext(index: number, value?: any): void;
|
|
|
13781
13769
|
* Create text node with binding
|
|
13782
13770
|
* Bindings should be handled externally with the proper interpolation(1-8) method
|
|
13783
13771
|
*
|
|
13784
|
-
* @param index Index of the node in the data array.
|
|
13785
13772
|
* @param value Stringified value to write.
|
|
13786
13773
|
*
|
|
13787
13774
|
* @codeGenApi
|
|
13788
13775
|
*/
|
|
13789
|
-
export declare function ɵɵtextBinding<T>(
|
|
13776
|
+
export declare function ɵɵtextBinding<T>(value: T | ɵNO_CHANGE): void;
|
|
13790
13777
|
|
|
13791
13778
|
/**
|
|
13792
13779
|
*
|