Insérer une méthode dans un component html
Bonjour à tous,
Débutant en angular, je souhaite gérer l'appel d'une méthode dans mon html
La méthode est créée ds le typescript et retourne un Enum comme ceci :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| public graphique(): EnumTypeGraphiqueReport {
if(IsIn(this.reportChart.proprieteGraphique.typeGraphique,
EnumTypeGraphiqueCenter.Histogramme,
EnumTypeGraphiqueCenter.HistogrammeEmpile,
EnumTypeGraphiqueCenter.HistogrammeEmpile100,
EnumTypeGraphiqueCenter.Courbe,
EnumTypeGraphiqueCenter.CourbeEmpile,
EnumTypeGraphiqueCenter.CourbeEmpile100,
EnumTypeGraphiqueCenter.Barre,
EnumTypeGraphiqueCenter.BarreEmpile,
EnumTypeGraphiqueCenter.BarreEmpile100)) {
return EnumTypeGraphiqueReport.Chart;
}
else if(IsIn(this.reportChart.proprieteGraphique.typeGraphique,
EnumTypeGraphiqueCenter.Camembert,
EnumTypeGraphiqueCenter.Anneau)) {
return EnumTypeGraphiqueReport.PieChart;
}
else if(IsIn(this.reportChart.proprieteGraphique.typeGraphique,
EnumTypeGraphiqueCenter.Radar)) {
return EnumTypeGraphiqueReport.PieChart;
}
} |
Dans le html je vousdrais appeler ma méthode de telle sorte qu'elle déclenche une certaine action selon le type de retour dans un ngIf mais je n'ai pas la bonne syntaxe
J'ai essayé ceci :
Code:
1 2
| *ngIf="!isLoading && !isErreur && graphique ==[EnumTypeGraphiqueReport.Chart]"
*ngIf="!isLoading && !isErreur && graphique =={{EnumTypeGraphiqueReport.Chart}}" |
Merci à vous