Last active
December 6, 2016 16:07
-
-
Save DWS-paris/78e8a198d75230130c0673c193b95532 to your computer and use it in GitHub Desktop.
Controleur utilisant des routes dynamiques #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, OnInit } from '@angular/core'; | |
// Import du composant à utiliser dans la route dynamique | |
import { MemoList } from '../memo-list/memo.list'; | |
// Décorateur du composant AppDashboard | |
@Component({ | |
selector: 'dashboard-page', | |
templateUrl: 'dashboard.html', | |
}) | |
// Export de la class du composant | |
export class AppDashboard { | |
// Création d'un fonction pour définir les routes dynamiques | |
getWpMemoItem(id: number): void { | |
// Injection du composant memo-list dans la vue | |
this.navCtrl.push( | |
MemoList, | |
// Ajout d'un objet en paramètre de la fonction pour afficher le bon contenu | |
{ item: id } | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment