0
<div ng-show="vm.loaderVisible">
    <div class="loader-icon"></div>
</div>

I have this HTML.

In controller, I'm creating IFrame element and then submitting it. I have iFrame on load callback, where I want to hide my loader.

IFrame.onload = () => {
    this.loaderVisible = false;
};

Problem is that if I write this.loaderVisible = false; outside callback, it works, if inside doesn't

Why?

aw-bubakik
  • 151
  • 1
  • 1
  • 9
  • 1
    You should read about the digest cycle and how Angular detects changes. It doesn't do so magically, it does so through digests which have to be triggered. So you'd need to put it inside a `$timeout` or an evalAsync or something like that. – Benjamin Gruenbaum Dec 11 '15 at 11:41
  • Also, take a look at [How to communicate between iframe and the parent site?](http://stackoverflow.com/a/9154267/1799146) – Julian Soro Dec 11 '15 at 11:41

0 Answers0