Skip to content

Instantly share code, notes, and snippets.

@jsanta
Created March 9, 2018 15:37
Show Gist options
  • Save jsanta/c1a8d35b18fd06dce9e25a6eca014afa to your computer and use it in GitHub Desktop.
Save jsanta/c1a8d35b18fd06dce9e25a6eca014afa to your computer and use it in GitHub Desktop.
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