I have the following class:
class QuestionService {
static $inject = [
"$interval",
"$http",
"$state"
];
constructor(
private $interval,
private $http: ng.IHttpService,
private $state
) {
$interval(function () {
this.putTestQuestionResponses() // <-- error here
// this.putTestQuestionResponse
// is not a function
}, 5 * 1000);
}
putTestQuestionResponses = () => {
// do something
};
}
What I wanted to do is call the putTestQuestionResponses() inside the $interval function above.
Is what I'm trying to do possible? Can someone let me know how to do this?