Typescript async/await doesnt update AngularJS view

前端 未结 10 534
小鲜肉
小鲜肉 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 10:02

    As it already has been described, angular does not know when the native Promise is finished. All async functions create a new Promise.

    The possible solution can be this:

    window.Promise = $q;

    This way TypeScript/Babel will use angular promises instead. Is it safe? Honestly I'm not sure - still testing this solution.

提交回复
热议问题