Created
December 6, 2016 14:45
-
-
Save DWS-paris/b35e36a1e5323d88ebfbeafaa0b63cc6 to your computer and use it in GitHub Desktop.
Configuration générale du composant principal #ionic2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, ViewChild } from '@angular/core'; | |
import { Platform, MenuController, Nav } from 'ionic-angular'; | |
import { StatusBar, Splashscreen } from 'ionic-native'; | |
// Décorateur du composant principal de l'application | |
@Component({ | |
templateUrl: 'app.html' | |
}) | |
// Export de la class du composant principal | |
export class MyApp { | |
// Intégration des fonctions du composant Nav (nécessaire pour l'utilisation du burger menu) | |
@ViewChild(Nav) nav: Nav; | |
// Création d'une fonction pour initialiser l'application | |
initializeApp() { | |
// Appel de la fonction ready() du composant Platform | |
this.platform.ready().then(() => { | |
// Définition des fonctions native à utiliser dand l'application | |
StatusBar.styleDefault(); | |
}); | |
} | |
// Constructeur du composant principal | |
constructor( | |
// Ajout des composants Platform et MenuController pour utilier le burger menu | |
public platform: Platform, | |
public menu: MenuController, | |
) { | |
// Initialisation de l'application | |
this.initializeApp(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment