Hello Urigo https://stackoverflow.com/users/1426570/urigo
I am hitting the cross domain scenario and tried your solution.. yet cross domain solution from you will be great help. Thanks in advance
Angularjs: call other scope which in iframe
Parent Frame is running on 8200 port
<div ng-controller="MyParentController">
<iframe frameborder="0" allowtransparency="true" scrolling="no" src="http://localhost:8999/Others/abcd.html" style="width: 100%; height: 800px;float:left">
</iframe>
</div>
In the child iFrame i have a button and following controller function in
app.controller('MyCtrl', ['$scope','$log','$window', function($scope, $log,$window ) {
$scope.invokeParentFunction = function(){
console.log(" Child invokeParentFunction function was called ");
var parentScope = $window.parent.angular.element($window.frameElement).scope();
console.log("parentScope ", parentScope);
}
}]);
Following is the error I am getting for not setting up the cross - domain .., which I cannot as my partner won't be allowing to open his production IP to mine for Cross domain calls.
Error: Blocked a frame with origin "http://localhost:8999" from accessing a cross-origin frame. at Error (native) at k.$scope.invokeParentFunction (http://localhost:8999/Others/abcd.js:158:36) at fb.functionCall (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular.min.js:177:68)
Any suggestions please.