ionic2一个需求模块的文件该是这样子的
Posted 石头皮
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ionic2一个需求模块的文件该是这样子的相关的知识,希望对你有一定的参考价值。
1、组件文件夹的文件
除了index.ts 其他文件为各个页面组件文件
2、index.ts的代码如下
import {SecurityFinance} from "./security-finance";
import {SecurityApply} from "./security-apply";
import {SecurityDisclaimer} from "./security-disclaimer";
export const FINANCE = [
SecurityFinance,
SecurityApply,
SecurityDisclaimer
]
3.在APP.module.ts文件中引入(注意加粗,其他代码不在此展示)
import {CheckPage} from ‘./../pages/startup/check‘;
import {FINANCE} from ‘./../pages/security-finance/index‘;
import {TranslateModule, TranslateStaticLoader, TranslateLoader} from "ng2-translate";
import {Http} from ‘@angular/http‘;
export function createTranslateLoader(http: Http) {
return new TranslateStaticLoader(http, ‘./assets/i18n‘, ‘.json‘);
}
@NgModule({
declarations: [
MyApp,
WIDGETS,
SecurityFinance,
FINANCE
],
imports: [
IonicModule.forRoot(MyApp, {}, {
links: [
}),
HttpInterceptorModule.withInterceptors([
{
deps: [Platform],
provide: HttpInterceptor,
useClass: AuthInterceptor,
multi: true
}
]),
TranslateModule.forRoot({
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [Http]
}),
ChartModule
],
bootstrap: [IonicApp],
entryComponents: [
FINANCE
],
providers: [SERVICE, Storage, {provide: ErrorHandler, useClass: IonicErrorHandler}]
})
export class AppModule {
}
以上是关于ionic2一个需求模块的文件该是这样子的的主要内容,如果未能解决你的问题,请参考以下文章