Skip to content
This repository was archived by the owner on Jul 26, 2023. It is now read-only.

Repository files navigation

Build Status

Angular Wait Until

Wait until the executed promise resolved to a true value, Execute it every x milliseconds and stop after y milliseconds.

Install

npm install angular-wait-until

Usage

Angular Module

angular.module('webApp',['angular.wait-until'])

Inside a controller/service

angular.module('webApp').controller('myController',function($scope,$q,WaitUntil){varmyPromise=newWaitUntil();varlater=+Date.now()+500;$scope.error='no error';myPromise.stopAfter(1*1000).tryEvery(100).stopOnFailure(false)//Ignore errors.execute(()=>{return$q((resolve,reject)=>{if(+Date.now()>=later){returnresolve(true);//some truthy value}reject(false);})}).then((value)=>$scope.name='Yey').catch((err)=>$scope.error=err);});

Additional Features

This repo is based on poll-until-promise. There you can read about additional features and functionality

About

Wait until an executed promise resolved to a true value

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages