前端外刊评论 2018-03-03
<ion-app></ion-app>
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app.module'; //设置AppModule为引导模块 platformBrowserDynamic().bootstrapModule(AppModule);
imports: [ IonicModule.forRoot(MyApp) ], bootstrap: [IonicApp]
@Component({ templateUrl: 'app.html' }) export class MyApp {}
import { Component } from '@angular/core'; @Component({ templateUrl: 'home-page.html' }) export class HomePage { constructor() { } }
import {Injectable} from "@angular/core"; //声明为可注入服务 单例 @Injectable() export class HomeService { constructor() { } }
import { NgModule } from '@angular/core'; import { IonicModule } from 'ionic-angular'; import { HomePage } from './home.page' import { HomeService } from './home.service' @NgModule({ //引入其他模块 imports: [ IonicModule ], //声明组件 declarations: [ HomePage ], //导出组件标签 exports:[ ], //导出组件类 entryComponents: [ HomePage ], //导出服务 providers: [ HomeService ] }) export class HomeModule {}
import { NgModule, ErrorHandler } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular'; import { StatusBar } from '@ionic-native/status-bar'; import { SplashScreen } from '@ionic-native/splash-screen'; import { MyApp } from './app.component'; import { TabsPage } from './tabs/tabs'; //引入自定义模块 import { HomeModule } from './home/home.module'; @NgModule({ declarations: [ MyApp, TabsPage ], imports: [ BrowserModule, IonicModule.forRoot(MyApp), //导入自定义模块 HomeModule ], bootstrap: [IonicApp], entryComponents: [ MyApp, TabsPage ], providers: [ StatusBar, SplashScreen, {provide: ErrorHandler, useClass: IonicErrorHandler} ] }) export class AppModule {}
templateUrl:'build/app.html',<ion-navid="nav"[root]="rootPage"#contentswipe-back-enabled="false"
项目要实现一个功能,在首页底部中间的tab弹出一个页面,而且是没有底部栏的,而不是像平常滑动的一个子页面。<ion-tab [root]="tab5Root" tabIcon="call" ="cal