ฉันอยากรู้ว่าฉันจะใช้การแก้ไขของ UI Router กับ TypeScript ได้อย่างไร
.state("signin.notActivated", <ng.ui.IState> {
controller: "SigninCtrl",
controllerAs: "signin",
url: "/notActivated",
resolve: {
inProgress: function() {
return { formData : null }
}
}
})
ในคอนโทรลเลอร์ของฉัน ฉันได้ฉีดการแก้ไขของฉันแล้ว
constructor(public $state : angular.ui.IState, private inProgress) {
this.init();
}
private init = () => {
this.someData = this.inProgress.formData; // error
}
ฉันได้รับข้อผิดพลาดของผู้ให้บริการที่ไม่รู้จัก เนื่องจาก TypeScript พยายามลงทะเบียนเป็นบริการ
สามารถทำได้หรือไม่?