Currently utilizing the ionic framework in conjunction with Angular JS.
In need of assistance on how to monitor the initiation of a web request.
To handle the completion of a request, I have created a directive with an onLoad attribute.
Here is the example 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});
})
}
}}]);
In the HTML
<iframe id="webFrame" iframe-onload="iframeLoadedCallBack()" style="width:100%;height:650px;" ng-src='{{goToURL}}' ng-hide='hideIFrame'></iframe>
In the Controller, the callback function is as follows:
$scope.iframeLoadedCallBack = function() {
console.log('iframeLoadedCallback');
// Perform actions upon completion of the web request here
};
Seeking guidance on how to track the beginning of a web request and obtain the requested URL.
Primarily operating as an iOS developer, looking to implement functionality similar to the UIWebViewDelegate protocol provided by Apple.
Appreciate any help or suggestions!