Skip to content

Commit

Permalink
fix(table): add missing constructors (#11252)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewseguin authored and jelbourn committed May 10, 2018
1 parent 56b884c commit 8e7dd80
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 7 deletions.
23 changes: 19 additions & 4 deletions src/lib/table/cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import {Directive, ElementRef, Input} from '@angular/core';
import {Directive, ElementRef, Input, TemplateRef} from '@angular/core';
import {
CdkCell,
CdkCellDef,
Expand All @@ -23,7 +23,12 @@ import {
selector: '[matCellDef]',
providers: [{provide: CdkCellDef, useExisting: MatCellDef}]
})
export class MatCellDef extends CdkCellDef { }
export class MatCellDef extends CdkCellDef {
// TODO(andrewseguin): Remove this constructor after compiler-cli is updated; see issue #9329
constructor(/** @docs-private */ public template: TemplateRef<any>) {
super(template);
}
}

/**
* Header cell definition for the mat-table.
Expand All @@ -33,7 +38,12 @@ export class MatCellDef extends CdkCellDef { }
selector: '[matHeaderCellDef]',
providers: [{provide: CdkHeaderCellDef, useExisting: MatHeaderCellDef}]
})
export class MatHeaderCellDef extends CdkHeaderCellDef { }
export class MatHeaderCellDef extends CdkHeaderCellDef {
// TODO(andrewseguin): Remove this constructor after compiler-cli is updated; see issue #9329
constructor(/** @docs-private */ public template: TemplateRef<any>) {
super(template);
}
}

/**
* Footer cell definition for the mat-table.
Expand All @@ -43,7 +53,12 @@ export class MatHeaderCellDef extends CdkHeaderCellDef { }
selector: '[matFooterCellDef]',
providers: [{provide: CdkFooterCellDef, useExisting: MatFooterCellDef}]
})
export class MatFooterCellDef extends CdkFooterCellDef { }
export class MatFooterCellDef extends CdkFooterCellDef {
// TODO(andrewseguin): Remove this constructor after compiler-cli is updated; see issue #9329
constructor(/** @docs-private */ public template: TemplateRef<any>) {
super(template);
}
}

/**
* Column definition for the mat-table.
Expand Down
26 changes: 23 additions & 3 deletions src/lib/table/row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
* found in the LICENSE file at https://angular.io/license
*/

import {ChangeDetectionStrategy, Component, Directive, ViewEncapsulation} from '@angular/core';
import {
ChangeDetectionStrategy,
Component,
Directive,
IterableDiffers, TemplateRef,
ViewEncapsulation
} from '@angular/core';
import {
CDK_ROW_TEMPLATE, CdkFooterRow, CdkFooterRowDef,
CdkHeaderRow,
Expand All @@ -24,7 +30,12 @@ import {
providers: [{provide: CdkHeaderRowDef, useExisting: MatHeaderRowDef}],
inputs: ['columns: matHeaderRowDef'],
})
export class MatHeaderRowDef extends CdkHeaderRowDef { }
export class MatHeaderRowDef extends CdkHeaderRowDef {
// TODO(andrewseguin): Remove this constructor after compiler-cli is updated; see issue #9329
constructor(template: TemplateRef<any>, _differs: IterableDiffers) {
super(template, _differs);
}
}

/**
* Footer row definition for the mat-table.
Expand All @@ -35,7 +46,12 @@ export class MatHeaderRowDef extends CdkHeaderRowDef { }
providers: [{provide: CdkFooterRowDef, useExisting: MatFooterRowDef}],
inputs: ['columns: matFooterRowDef'],
})
export class MatFooterRowDef extends CdkFooterRowDef { }
export class MatFooterRowDef extends CdkFooterRowDef {
// TODO(andrewseguin): Remove this constructor after compiler-cli is updated; see issue #9329
constructor(template: TemplateRef<any>, _differs: IterableDiffers) {
super(template, _differs);
}
}

/**
* Data row definition for the mat-table.
Expand All @@ -48,6 +64,10 @@ export class MatFooterRowDef extends CdkFooterRowDef { }
inputs: ['columns: matRowDefColumns', 'when: matRowDefWhen'],
})
export class MatRowDef<T> extends CdkRowDef<T> {
// TODO(andrewseguin): Remove this constructor after compiler-cli is updated; see issue #9329
constructor(template: TemplateRef<any>, _differs: IterableDiffers) {
super(template, _differs);
}
}

/** Footer template container that contains the cell outlet. Adds the right class and role. */
Expand Down

0 comments on commit 8e7dd80

Please sign in to comment.