import { Component } from '@angular/core';
@Component({
selector: 'tabs-demo',
template: `
Hidden By Default
Source
Click a button to toggle table visibilities
hidden Table
ngIf Table
`
})
export class TabsDemoComponent {
rows = [];
tab1 = true;
tab2 = false;
tab3 = false;
constructor() {
this.fetch((data) => {
this.rows = data;
});
}
fetch(cb) {
const req = new XMLHttpRequest();
req.open('GET', `assets/data/100k.json`);
req.onload = () => {
cb(JSON.parse(req.response));
};
req.send();
}
}