0

I am loading some scripts in my project using angular loadscript. I have to reject the call after some ideal time so that I can show errors on my dashboard with project load.

angularLoad.loadScript(script)
    .then(function () {
        $scope.err = false;
    })
    .catch(function () {
        $scope.err = true;
    });

One solution is - apply timeout. Any other solutions?

7
  • Your code seems enough. Why do you want to set a timeOut? Commented Apr 27, 2017 at 7:24
  • No this angular script showing pending for some times on network tab. and rest other resource loads in seconds. so my other details loads correctly on my dashboard and this err block is taking time to show because of the loading delay. I wanted to show all details on same time Commented Apr 27, 2017 at 7:25
  • So you want to reject the promise after waiting for XX seconds? Commented Apr 27, 2017 at 7:27
  • Yes , I want to reject the promise after waiting for XX seconds :) Commented Apr 27, 2017 at 7:27
  • Does this help you? Commented Apr 27, 2017 at 7:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.