Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
DataGridComponent for displaying a filtered data grid.
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