IonicModule
IonicModule is an NgModule that helps bootstrap a whole Ionic App. By passing a root component, IonicModule will make sure that all the components and directives from the framework are provided. This includes components such as Tabs, Menus, and Slides, as well as classes like AlertController.
We're also able to pass any configuration to our app as a second argument for .forRoot
. This is any valid config property from the Config Class.
The last functionality that IonicModule allows you to configure is optional routes for DeepLinker. For more information on DeepLinker, please see the DeepLinker Docs
Usage
import { NgModule } from '@angular/core';
import { IonicApp, IonicModule } from 'ionic-angular';
import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
@NgModule({
declarations: [
MyApp,
HomePage
],
imports: [
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage
],
providers: []
})
export class AppModule {}
Static Members
forRoot(appRoot, config, deepLinkConfig)
Set the root app component for you IonicModule
Param | Type | Details |
---|---|---|
appRoot |
any
|
The root AppComponent for this app. |
config |
any
|
Config Options for the app. Accepts any config property. |
deepLinkConfig |
any
|
Any configuration needed for the Ionic Deeplinker. |