import { IScope } from 'angular'; export const promiseToDigest = ($scope: IScope) => (promise: Promise) => promise.finally($scope.$evalAsync);