@@ -85,12 +85,8 @@ export class NgForOfRow<T> {
85
85
*
86
86
* @stable
87
87
*/
88
- @Directive ( {
89
- selector : '[ngFor][ngForOf]' ,
90
- providers : [ { provide : forwardRef ( ( ) => NgFor ) , useExisting : forwardRef ( ( ) => NgForOf ) } ]
91
- } )
92
- export class NgForOf < T > implements DoCheck ,
93
- OnChanges {
88
+ @Directive ( { selector : '[ngFor][ngForOf]' } )
89
+ export class NgForOf < T > implements DoCheck , OnChanges {
94
90
@Input ( ) ngForOf : NgIterable < T > ;
95
91
@Input ( )
96
92
set ngForTrackBy ( fn : TrackByFunction < T > ) {
@@ -191,66 +187,11 @@ class RecordViewTuple<T> {
191
187
}
192
188
193
189
/**
194
- * The `NgFor` directive instantiates a template once per item from an iterable. The context
195
- * for each instantiated template inherits from the outer context with the given loop variable
196
- * set to the current item from the iterable.
197
- *
198
- * ### Local Variables
199
- *
200
- * `NgFor` provides several exported values that can be aliased to local variables:
201
- *
202
- * * `index` will be set to the current loop iteration for each template context.
203
- * * `first` will be set to a boolean value indicating whether the item is the first one in the
204
- * iteration.
205
- * * `last` will be set to a boolean value indicating whether the item is the last one in the
206
- * iteration.
207
- * * `even` will be set to a boolean value indicating whether this item has an even index.
208
- * * `odd` will be set to a boolean value indicating whether this item has an odd index.
209
- *
210
- * ### Change Propagation
211
- *
212
- * When the contents of the iterator changes, `NgFor` makes the corresponding changes to the DOM:
213
- *
214
- * * When an item is added, a new instance of the template is added to the DOM.
215
- * * When an item is removed, its template instance is removed from the DOM.
216
- * * When items are reordered, their respective templates are reordered in the DOM.
217
- * * Otherwise, the DOM element for that item will remain the same.
218
- *
219
- * Angular uses object identity to track insertions and deletions within the iterator and reproduce
220
- * those changes in the DOM. This has important implications for animations and any stateful
221
- * controls (such as `<input>` elements which accept user input) that are present. Inserted rows can
222
- * be animated in, deleted rows can be animated out, and unchanged rows retain any unsaved state
223
- * such as user input.
224
- *
225
- * It is possible for the identities of elements in the iterator to change while the data does not.
226
- * This can happen, for example, if the iterator produced from an RPC to the server, and that
227
- * RPC is re-run. Even if the data hasn't changed, the second response will produce objects with
228
- * different identities, and Angular will tear down the entire DOM and rebuild it (as if all old
229
- * elements were deleted and all new elements inserted). This is an expensive operation and should
230
- * be avoided if possible.
231
- *
232
- * To customize the default tracking algorithm, `NgFor` supports `trackBy` option.
233
- * `trackBy` takes a function which has two arguments: `index` and `item`.
234
- * If `trackBy` is given, Angular tracks changes by the return value of the function.
235
- *
236
- * ### Syntax
237
- *
238
- * - `<li *ngFor="let item of items; let i = index; trackBy: trackByFn">...</li>`
239
- * - `<li template="ngFor let item of items; let i = index; trackBy: trackByFn">...</li>`
240
- *
241
- * With `<template>` element:
242
- *
243
- * ```
244
- * <template ngFor let-item [ngForOf]="items" let-i="index" [ngForTrackBy]="trackByFn">
245
- * <li>...</li>
246
- * </template>
247
- * ```
248
- *
249
- * ### Example
250
- *
251
- * See a [live demo](http://plnkr.co/edit/KVuXxDp0qinGDyo307QW?p=preview) for a more detailed
252
- * example.
253
- *
254
- * @deprecated v4.0.0 - Use `NgForOf<T>` instead.
190
+ * @deprecated from v4.0.0 - Use NgForOf<any> instead.
191
+ */
192
+ export type NgFor = NgForOf < any > ;
193
+
194
+ /**
195
+ * @deprecated from v4.0.0 - Use NgForOf instead.
255
196
*/
256
- export class NgFor extends NgForOf < any > { }
197
+ export const NgFor = NgForOf ;
0 commit comments