Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

interface example

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"},
  ]
}
Source by www.itsolutionstuff.com #
 
PREVIOUS NEXT
Tagged: #interface
ADD COMMENT
Topic
Name
1+7 =