I am using ionic framework and Angular JS.
I am not sure where to start to track start of a web request.
For end request, I write a directive with onLoad tag.
here is the code
Directive.js
app.directive('iframeOnload', [function(){
return {
scope: {
callBack: '&iframeOnload'
},
link: function(scope, element, attrs){
element.on('load', function(){
return scope.callBack({DOMelement: this});
})
}
}}]);
At the HTML
<iframe id="webFrame" iframe-onload="iframeLoadedCallBack()" style="width:100%;height:650px;" ng-src='{{goToURL}}' ng-hide='hideIFrame'></iframe>
At the Controller The callback function is
$scope.iframeLoadedCallBack = function() {
console.log('iframeLoadedCallback');
// finished web request callback do something here
};
I guess there is something similar for start of the web request. And I need to track the send request URL.
I am an iOS developer, And actually I would like to do something similar to this protocol UIWebViewDelegate.
Thanks a lot