77 */
88
99import { Component , ViewChild } from '@angular/core' ;
10- import { Element , ELEMENT_DATA } from '../element-data' ;
10+ import { PeriodicElement , ELEMENT_DATA } from '../element-data' ;
1111import { CdkTable } from '@angular/cdk/table' ;
1212import { MatRadioChange , MatTable , MatTableDataSource } from '@angular/material' ;
1313import { Observable } from 'rxjs' ;
@@ -28,18 +28,20 @@ export class DataInputTableDemo {
2828 matTableDataSource = new MatTableDataSource ( this . data ) ;
2929
3030 trackByStrategy : TrackByStrategy = 'reference' ;
31- trackBy = ( index : number , item : Element ) => {
31+ trackBy = ( index : number , item : PeriodicElement ) => {
3232 switch ( this . trackByStrategy ) {
3333 case 'position' : return item . position ;
3434 case 'reference' : return item ;
3535 case 'index' : return index ;
3636 }
3737 }
3838
39- dataSource : DataSource < Element > | Observable < Element [ ] > | Element [ ] | null = this . data ;
39+ dataSource : DataSource < PeriodicElement > |
40+ Observable < PeriodicElement [ ] > |
41+ PeriodicElement [ ] | null = this . data ;
4042
41- @ViewChild ( CdkTable ) cdkTable : CdkTable < Element > ;
42- @ViewChild ( MatTable ) matTable : MatTable < Element > ;
43+ @ViewChild ( CdkTable ) cdkTable : CdkTable < PeriodicElement > ;
44+ @ViewChild ( MatTable ) matTable : MatTable < PeriodicElement > ;
4345
4446 changeInput ( e : MatRadioChange ) {
4547 this . inputType = e . value ;
0 commit comments