0

How can i count number of times the iframe has redirect with AngularJS?

I do so far with this code, but no luck.

I found if using JQuery can done like this.

Any help would be greatly appreciated!

Community
  • 1
  • 1
Idham Perdameian
  • 2,199
  • 24
  • 34

1 Answers1

0

Finally i get the answer, this the code:

.run(function($ionicPlatform, $window) {
  $ionicPlatform.ready(function() {
    var i = 0;
    $window.iframeLoaded = function () {
        console.log('value of i: '+i);
        if(i === 1) {
            // something todo
        }
        i++;
    };
  });
})

Html:

<iframe  ng-src="{{frameUrl}}" onLoad="iframeLoaded()">
    Something was wrong!.
</iframe>
Idham Perdameian
  • 2,199
  • 24
  • 34