Typescript async/await doesnt update AngularJS view

前端 未结 10 538
小鲜肉
小鲜肉 2020-12-01 09:17

I\'m using Typescript 2.1(developer version) to transpile async/await to ES5.

I\'ve noticed that after I change any property which is bound to view in my async funct

10条回答
  •  感动是毒
    2020-12-01 09:59

    Is there any workaround so I don't have to manually call $scope.$apply() every time?

    This is because TypeScript uses the browser native Promise implementation and that is not what Angular 1.x knows about. To do its dirty checking all async functions that it does not control must trigger a digest cycle.

提交回复
热议问题