Currently, I am utilizing Typescript 2.1 (developer version) to transpile async/await to ES5.
An issue I have encountered is that when I modify any property linked to the view within my async function, the view does not automatically reflect the updated value. As a result, I find myself having to invoke $scope.$apply() at the end of each function to ensure the latest values are displayed.
Below is an example of async code:
async testAsync() {
await this.$timeout(2000);
this.text = "Changed";
//$scope.$apply(); <-- hoping to find an alternative
}
Unfortunately, the new value of text
is not immediately visible in the view after this change.
Are there any workarounds available so that I can avoid manually calling $scope.$apply() every single time?