Modules

We mentioned modules at the beginning of this article and how they help us organize our project. With that in mind, take a look at this app module:

import { BrowserModule } from '@angular/platform-browser';import { NgModule } from '@angular/core';import { AppComponent } from './app.component';import { UiButtonDirective } from './ui-button.directive';import { WhenDirective } from './when.directive';@NgModule({  declarations: [    AppComponent,    UiButtonDirective,    WhenDirective  ],  imports: [    BrowserModule  ],  providers: [],  bootstrap: [AppComponent]})export class AppModule { }

Here is a module from the directive:

examples:import { BrowserModule } from '@angular/platform-browser';import { NgModule } from '@angular/core';import { AppComponent ...

Get TypeScript 2.x for Angular Developers now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.