I have the following Typescript:
module MainCtrl {
interface IMainController {
getCustomers(): any;
}
class MainController implements IMainController {
static $inject = ['$scope', 'ApiServices','RememberSrvc'];
constructor(private $scope: any,
private ApiServices: ApiServices.IApiService,
private RememberSrvc: RememberSrvc.IRememberService) {
var vm = this;
}
getCustomers(){
this.ApiServices.get_request_params(, "")
.then(function(data) {
this.RememberSrvc.remember(data);//this is not working
}, function(err) {
});
}
}
angular.module('app').controller('MainCtrl', MainController);
}
I cannot access the RememberSrvc from the then block. And although I can console.log the response. I cannot bind data to my view.