首页 > 其他 > 详细

[Angular 2] Import custom module

时间:2016-09-19 19:48:27      阅读:151      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!