import { Component } from '@angular/core';
//Student interface
interface Student {
id: number;
name: string;
}
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
})
export class AppComponent {
name = 'Angular';
//Use of interface
students: Student[] = [
{id: 1, name: "Hardik"},
{id: 2, name: "Paresh"},
{id: 3, name: "Rakesh"},
]
}