Interfaces

models/User.ts

export interface User {
  firstName: string,
  lastName: string,
  age: number,
  address: {
    street: string,
    city: string,
    state: string
  }
}

component.ts

import { User } from '../../models/User';

export class UserComponent {
  // Properties
  user: User;
}
Was this page helpful?