码迷,mamicode.com
首页 > 其他好文 > 详细

[Angular 2] Import custom module

时间:2016-09-19 19:48:51      阅读:130      评论:0      收藏:0      [点我收藏+]

标签:

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 {

}

 

[Angular 2] Import custom module

标签:

原文地址:http://www.cnblogs.com/Answer1215/p/5886157.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!