Typescript async/await and angular $q service

后端 未结 3 594
孤城傲影
孤城傲影 2021-02-05 08:51

New TypeScript async/await feature uses ES6 promises. AngularJS uses $q service promises with slightly different interface.

Is there any way to use TypeScri

3条回答
  •  孤独总比滥情好
    2021-02-05 09:00

    You can make it work like this:

    angular.module('your app')
            .run(['$window', '$q', function($window, $q) {
                $window.Promise = $q;
            }]);
    

提交回复
热议问题