[Angular 2] Import custom module
The application structure:

in app.module.ts:
import { NgModule} from "@angular/core";
import {BrowserModule} from "@angular/platform-browser";
import {AppComponent} from './app.component';
import {HomeModule} from './components/home/home.module';
@NgModule({
imports:[BrowserModule, HomeModule],
declarations:[AppComponent],
bootstrap:[AppComponent]
})
export class AppModule{}
components/home/home.module.ts:
import { NgModule} from '@angular/core';
import {HomeComponent} from './home.component';
@NgModule({
declarations: [HomeComponent],
exports: [HomeComponent]
})
export class HomeModule {
}

浙公网安备 33010602011771号