import { Component } from '@angular/core';
@Component({
selector: 'footer-demo',
template: `
Custom Footer
Source
Summary: Gender: Female
Rows: {{rowCount}} |
Size: {{pageSize}} |
Current: {{curPage}} |
Offset: {{offset}}
`
})
export class FooterDemoComponent {
rows = [];
columns = [
{ prop: 'name' },
{ name: 'Gender' },
{ name: 'Company' }
];
constructor() {
this.fetch((data) => {
this.rows = data.splice(0, 5);
});
}
fetch(cb) {
const req = new XMLHttpRequest();
req.open('GET', `assets/data/company.json`);
req.onload = () => {
cb(JSON.parse(req.response));
};
req.send();
}
}