import { Component, OnInit } from '@angular/core'; export interface IStudent { name: string; gender: string; country: string; } @Component({ selector: 'app-regular-table', templateUrl: './regular-table.component.html', styleUrls: ['./regular-table.component.scss'] }) export class RegularTableComponent implements OnInit { students: IStudent[]; ngOnInit(): void { fetch('./assets/data/students.json').then(res => res.json()) .then(json => { this.students = json; }); } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter