0

The below timeout function is not working on iOS devices. Is settimeout function does not work on iOS devices? Is there something missing in below code?

_timeoutService: ng.ITimeoutService



this._timeoutService(1200, true).then(() => {
          //below statement does not have any effect on iOS devices
          // enable my angular material control
          // set some text in an angular material input element
           this.supportEmailCtrlDisabled = false;
        });

I came across this post https://stackoverflow.com/a/10991974/5252545. Looks like a similar issue. But not sure - 1. If this solves my issue? 2. what a 'bind' method is? 3. How to write the method in typescript?

Community
  • 1
  • 1
LearnForever
  • 175
  • 2
  • 3
  • 15

1 Answers1

1

//below statement does not have any effect on iOS devices

Suspect the issue is higher up the call chain. The function is possibly called from outside $apply which means the then doesn't fire.

Possible fix

this._timeoutService(1200, true).then(() => {
          //below statement does not have any effect on iOS devices
          // enable my angular material control
          // set some text in an angular material input element
           this.supportEmailCtrlDisabled = false;
           $scope.$apply()
        });
basarat
  • 261,912
  • 58
  • 460
  • 511