ionic2一个需求模块的文件该是这样子的
2024-10-01 03:04:03
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 { }
最新文章
- 原生js封装Ajax
- BW知识问答锦集
- asp.net identity 2.2.0 在MVC下的角色启用和基本使用(一)
- IOS第13天(1,私人通讯录,登陆功能,界面的跳转传值,自定义cell,编辑界面)
- 国内外比较出名的做MySQL的公司以及原因
- Linux内存寻址之分页机制
- 如何在 CentOS 7 上安装 Redis 服务器
- Linux命令行学习
- java的socket通信
- x264源代码简单分析:滤波(Filter)部分
- HTML5 FileReader实现图片上传前预览
- noip2018 d2t3 保卫王国 解题报告
- Skyline开发1-环境搭建
- 5.用 CSS 创作一个立体滑动 toggle 交互控件
- mysql 2003: Can't connect to MySQL server on '127.0.0.1:3306' (99)
- CG图形学的工具
- mac下搭建cocos2d-x2.2.1版本android编译环境教程
- git-【八】多人协作
- [AngularJS] $scope.$watch
- 20145335《java程序设计》第5次实验报告