Put in order · Angular course · Module 1: Introduction to Angular

Order within a component file

Order the elements of a standalone component file (from top to bottom):

Items to put in order

  • @Component({ standalone: true, ... })
  • import { Component } from '@angular/core';
  • export class KatanaComponent {
  • }
Show the answer

Correct order:

  1. import { Component } from '@angular/core';
  2. @Component({ standalone: true, ... })
  3. export class KatanaComponent {
  4. }