Skip to content

Instantly share code, notes, and snippets.

@jsanta
Created March 9, 2018 15:37
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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