Ich verwende Typoskript mit eckigen 1.5. Ich habe ein Problem bei der Übergabe einer Variablen an eine Komponente an eine Bindung.Angular 1.5-Komponente in Typescript übergeben Binding variable Zeichenfolge
Hier ist der relevante Code - ich habe den meisten nicht relevanten Code entfernt.
module xyz.dashboard {
class PatientPhaseCountController {
public static $inject = [];
public title: string;
public chartType: string;
///// /* @ngInject */
constructor() {
this.title = 'Patient Phase Count';
console.log(this.chartType);
this.$onInit();
}
public $onInit(): void {
console.log(this);
};
}
class PatientPhaseCount implements ng.IComponentOptions {
public bindings: any;
public controller: any;
public templateUrl: string;
constructor() {
this.bindings = {
chartType: '@'
};
this.controller = PatientPhaseCountController;
this.templateUrl = 'app/dashboard/patientPhaseCount/patientPhaseCount.component.html';
}
}
}
und hier ist der HTML-Schnipsel:
immer charttype nicht definiert ist. Jede Hilfe wird geschätzt.