1
如何訪問NavService(即控制器的上下文)?
module MyModule {
export class MyClass {
public static $inject = ['$scope', 'NavService'];
constructor(private $scope: any, private NavService: MyWizard.NavService) {
this.$scope.okCmd = this.okCmd;
}
okCmd() {
this.NavService.next('details');
}
}
結果:NavService
是不確定的,因爲this.
實際上代表$scope
。
非常感謝你的解釋。即使我知道這一點,但仍需要大量的練習。 – celerno