diff --git a/modules/@angular/common/src/common.ts b/modules/@angular/common/src/common.ts index 22fb35d7aea47e..822e288f5e0962 100644 --- a/modules/@angular/common/src/common.ts +++ b/modules/@angular/common/src/common.ts @@ -13,7 +13,7 @@ */ export * from './location/index'; export {NgLocaleLocalization, NgLocalization} from './localization'; -export {CommonModule, DeprecatedCommonModule} from './common_module'; +export {CommonModule} from './common_module'; export {NgClass, NgFor, NgForOf, NgIf, NgPlural, NgPluralCase, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgTemplateOutlet, NgComponentOutlet} from './directives/index'; export {AsyncPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, JsonPipe, LowerCasePipe, CurrencyPipe, DecimalPipe, PercentPipe, SlicePipe, UpperCasePipe, TitleCasePipe} from './pipes/index'; export {VERSION} from './version'; diff --git a/modules/@angular/common/src/common_module.ts b/modules/@angular/common/src/common_module.ts index 097e413e75920a..7c80454f9337dc 100644 --- a/modules/@angular/common/src/common_module.ts +++ b/modules/@angular/common/src/common_module.ts @@ -29,12 +29,3 @@ import {COMMON_PIPES} from './pipes/index'; }) export class CommonModule { } - -/** - * A module to contain deprecated directives. - * - * @deprecated - */ -@NgModule({declarations: [COMMON_DEPRECATED_DIRECTIVES], exports: [COMMON_DEPRECATED_DIRECTIVES]}) -export class DeprecatedCommonModule { -} \ No newline at end of file diff --git a/modules/@angular/common/src/directives/ng_for_of.ts b/modules/@angular/common/src/directives/ng_for_of.ts index c72e55c18e0017..e4536e9f8fc211 100644 --- a/modules/@angular/common/src/directives/ng_for_of.ts +++ b/modules/@angular/common/src/directives/ng_for_of.ts @@ -85,12 +85,8 @@ export class NgForOfRow { * * @stable */ -@Directive({ - selector: '[ngFor][ngForOf]', - providers: [{provide: forwardRef(() => NgFor), useExisting: forwardRef(() => NgForOf)}] -}) -export class NgForOf implements DoCheck, - OnChanges { +@Directive({selector: '[ngFor][ngForOf]'}) +export class NgForOf implements DoCheck, OnChanges { @Input() ngForOf: NgIterable; @Input() set ngForTrackBy(fn: TrackByFunction) { @@ -191,66 +187,11 @@ class RecordViewTuple { } /** - * The `NgFor` directive instantiates a template once per item from an iterable. The context - * for each instantiated template inherits from the outer context with the given loop variable - * set to the current item from the iterable. - * - * ### Local Variables - * - * `NgFor` provides several exported values that can be aliased to local variables: - * - * * `index` will be set to the current loop iteration for each template context. - * * `first` will be set to a boolean value indicating whether the item is the first one in the - * iteration. - * * `last` will be set to a boolean value indicating whether the item is the last one in the - * iteration. - * * `even` will be set to a boolean value indicating whether this item has an even index. - * * `odd` will be set to a boolean value indicating whether this item has an odd index. - * - * ### Change Propagation - * - * When the contents of the iterator changes, `NgFor` makes the corresponding changes to the DOM: - * - * * When an item is added, a new instance of the template is added to the DOM. - * * When an item is removed, its template instance is removed from the DOM. - * * When items are reordered, their respective templates are reordered in the DOM. - * * Otherwise, the DOM element for that item will remain the same. - * - * Angular uses object identity to track insertions and deletions within the iterator and reproduce - * those changes in the DOM. This has important implications for animations and any stateful - * controls (such as `` elements which accept user input) that are present. Inserted rows can - * be animated in, deleted rows can be animated out, and unchanged rows retain any unsaved state - * such as user input. - * - * It is possible for the identities of elements in the iterator to change while the data does not. - * This can happen, for example, if the iterator produced from an RPC to the server, and that - * RPC is re-run. Even if the data hasn't changed, the second response will produce objects with - * different identities, and Angular will tear down the entire DOM and rebuild it (as if all old - * elements were deleted and all new elements inserted). This is an expensive operation and should - * be avoided if possible. - * - * To customize the default tracking algorithm, `NgFor` supports `trackBy` option. - * `trackBy` takes a function which has two arguments: `index` and `item`. - * If `trackBy` is given, Angular tracks changes by the return value of the function. - * - * ### Syntax - * - * - `
  • ...
  • ` - * - `
  • ...
  • ` - * - * With `