Skip to content

Commit dc33472

Browse files
authored
fix(material-experimental/mdc-table): don't import template from other (#21594)
package
1 parent 270b751 commit dc33472

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

src/material-experimental/mdc-table/text-column.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import {CdkTextColumn} from '@angular/cdk/table';
1010
import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/core';
11-
import {_MAT_TEXT_COLUMN_TEMPLATE} from '@angular/material/table';
1211

1312
/**
1413
* Column that simply shows text content for the header and row cells. Assumes that the table
@@ -21,7 +20,16 @@ import {_MAT_TEXT_COLUMN_TEMPLATE} from '@angular/material/table';
2120
*/
2221
@Component({
2322
selector: 'mat-text-column',
24-
template: _MAT_TEXT_COLUMN_TEMPLATE,
23+
template: `
24+
<ng-container matColumnDef>
25+
<th mat-header-cell *matHeaderCellDef [style.text-align]="justify">
26+
{{headerText}}
27+
</th>
28+
<td mat-cell *matCellDef="let data" [style.text-align]="justify">
29+
{{dataAccessor(data, name)}}
30+
</td>
31+
</ng-container>
32+
`,
2533
encapsulation: ViewEncapsulation.None,
2634
// Change detection is intentionally not set to OnPush. This component's template will be provided
2735
// to the table to be inserted into its view. This is problematic when change detection runs since

src/material/table/text-column.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,6 @@
99
import {CdkTextColumn} from '@angular/cdk/table';
1010
import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/core';
1111

12-
export const _MAT_TEXT_COLUMN_TEMPLATE = `
13-
<ng-container matColumnDef>
14-
<th mat-header-cell *matHeaderCellDef [style.text-align]="justify">
15-
{{headerText}}
16-
</th>
17-
<td mat-cell *matCellDef="let data" [style.text-align]="justify">
18-
{{dataAccessor(data, name)}}
19-
</td>
20-
</ng-container>
21-
`;
22-
2312
/**
2413
* Column that simply shows text content for the header and row cells. Assumes that the table
2514
* is using the native table implementation (`<table>`).
@@ -31,7 +20,16 @@ export const _MAT_TEXT_COLUMN_TEMPLATE = `
3120
*/
3221
@Component({
3322
selector: 'mat-text-column',
34-
template: _MAT_TEXT_COLUMN_TEMPLATE,
23+
template: `
24+
<ng-container matColumnDef>
25+
<th mat-header-cell *matHeaderCellDef [style.text-align]="justify">
26+
{{headerText}}
27+
</th>
28+
<td mat-cell *matCellDef="let data" [style.text-align]="justify">
29+
{{dataAccessor(data, name)}}
30+
</td>
31+
</ng-container>
32+
`,
3533
encapsulation: ViewEncapsulation.None,
3634
// Change detection is intentionally not set to OnPush. This component's template will be provided
3735
// to the table to be inserted into its view. This is problematic when change detection runs since

tools/public_api_guard/material/table.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
export declare const _MAT_TEXT_COLUMN_TEMPLATE = "\n <ng-container matColumnDef>\n <th mat-header-cell *matHeaderCellDef [style.text-align]=\"justify\">\n {{headerText}}\n </th>\n <td mat-cell *matCellDef=\"let data\" [style.text-align]=\"justify\">\n {{dataAccessor(data, name)}}\n </td>\n </ng-container>\n";
2-
31
export declare class _MatTableDataSource<T, P extends Paginator> extends DataSource<T> {
42
_renderChangesSubscription: Subscription | null;
53
get data(): T[];

0 commit comments

Comments
 (0)