Created
March 9, 2018 15:37
-
-
Save jsanta/c1a8d35b18fd06dce9e25a6eca014afa to your computer and use it in GitHub Desktop.
DataGridComponent for displaying a filtered data grid.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Company } from './../../data/company-data'; | |
import { Component, OnInit, Input } from '@angular/core'; | |
@Component({ | |
selector: 'app-data-grid', | |
templateUrl: './data-grid.component.html', | |
styleUrls: ['./data-grid.component.sass'] | |
}) | |
export class DataGridComponent implements OnInit { | |
filteredData: Array<Company>; | |
@Input() | |
set data(data: Array<Company>) { | |
this.filteredData = data; | |
}; | |
get data() { | |
return this.filteredData; | |
} | |
_animate: boolean; | |
@Input() | |
set animate(animate: boolean) { | |
this._animate = animate; | |
}; | |
get animate() { | |
return this._animate; | |
} | |
constructor() {} | |
ngOnInit() { | |
this.filteredData = this.data; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment