My current setup involves Typescript with Angular combined with Breezejs.
class CounterController {
count: number = 0;
static $inject = ['$scope'];
constructor($scope) {
$scope.vm = this;
}
setCount14(): void {
this.count = 14; // works
}
getQuestions(): void {
var manager = new breeze.EntityManager('/breeze/dbentities');
var query = breeze.EntityQuery.from("Corporations").where("Name", "startsWith", "Zen");
manager.executeQuery(query)
.then(querySucceeded);
function querySucceeded(data) {
this.count= 1; // works not!
}
}
}
Is there a way to correctly access the count
property in the querySucceeded
function?
Edit: Is it possible to pass a typescript function to executeQuery(query).then
?
Solution: Pass Typescript function as a Javascript function
Then calling the scope.$apply()
actually applies the bindings.