ionic3我爱编程

Ionic3 目录结构解析

2018-03-20  本文已影响14人  3d3b346bd6db

IDE使用的是Visual Studio Code

参考链接:http://blog.csdn.net/sinat_28597179/article/details/79094235

1、打开项目文件夹,再打开src目录

2、SRC目录解析

3、app.module.ts 解析

/**根模块--告诉ionic如何组装应用 */

//引入ionic、angular的系统模块

import{NgModule,ErrorHandler}from'@angular/core';

import{BrowserModule}from'@angular/platform-browser';

import{IonicApp,IonicModule,IonicErrorHandler}from'ionic-angular';

//引入根组件

import{MyApp}from'./app.component';

//引入自定义的组件(页面)

import{AboutPage}from'../pages/about/about';

import{ContactPage}from'../pages/contact/contact';

import{HomePage}from'../pages/home/home';

import{TabsPage}from'../pages/tabs/tabs';

//打包成app后配置启动画面、导航条等的服务--忽略

import{StatusBar}from'@ionic-native/status-bar';

import{SplashScreen}from'@ionic-native/splash-screen';

@NgModule({

declarations:[//声明组件

MyApp,

AboutPage,

ContactPage,

HomePage,

TabsPage

],

imports:[//引入的模块(依赖的模块)

BrowserModule,

IonicModule.forRoot(MyApp)

],

bootstrap:[IonicApp],//启动模块

entryComponents:[//配置不会在模板中使用的组件

MyApp,

AboutPage,

ContactPage,

HomePage,

TabsPage

],

providers:[//配置服务

StatusBar,

SplashScreen,

{provide:ErrorHandler,useClass:IonicErrorHandler}

]

})

exportclassAppModule{}

上一篇下一篇

猜你喜欢

热点阅读