I have an iframe that I use to contain a file upload form:
<iframe name="fileUploadCallback" style=" border: 0; width : 100%;" ng-src="{{uploadIframeSrc}}"></iframe>
In the controller, I set the uploadIframeSrc to some html page on the server that contains the file upload form.
On the submit, the form is sent to the server and the server redirects the Location to another webpage that is also on the server.
In that returned webpage, I have a button to reset the iframe to point at the original form. I used this code to achieve it:
//button.onClick
this.parent.angular.element('iFrame').scope().uploadIframeSrc = "/original/form.html"
This doesn't work. In fact, when I try to call a method set the $scope.uploadIframeSrc, it doens't work, even though when I call the same mehod from the controller when the page first loads, it works.
this.parent.angular.element('iFrame').scope().setIFrameSrc();
I suspect that the ng-src directive has been replaced by the HTTP header-location, and as such setting the scope variable to the new URI doesn't have an effect.
Is there a way to restore the ng-src directive?
EDIT 1: I also tried returning a raw HTML insteat of a HTTP redirect.
If the answer to the original questin is No, is there a way to try to have the server return something while allowing the iframe to retain the linkage with the scope variable?