Need help upgrading to Ionic Framework 4.0? Get assistance with our Enterprise Migration Services EXPLORE NOW

IonicModule

Improve this doc

IonicModule is an NgModule that bootstraps an Ionic App. By passing a root component, IonicModule will make sure that all of the components, directives, and providers from the framework are imported.

Any configuration for the app can be passed as the second argument to forRoot. This can be any valid property from the Config.

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: [
    BrowserModule,
    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.

API

Native

General