Put in order · Angular course · Module 2: Components

Summary: Component Syntax

Arrange the main parts of a component file in their typical order (top to bottom):

Items to put in order

  • import { Component } from '@angular/core';
  • @Component({ ... })
  • }
  • export class SamuraiComponent {
  • // properties and methods
Show the answer

Correct order:

  1. import { Component } from '@angular/core';
  2. @Component({ ... })
  3. export class SamuraiComponent {
  4. // properties and methods
  5. }