问题
I'm using Angularjs for some months and it works like a charms in Chrome/Firefox/Safari but face some problems with IE11 and Edge.
It seems my problem come from ng-src since images are not displayed and src attribute is never set.
Here is the code:
<div class="cell col-xs-12 col-sm-6 col-md-4 col-lg-3" ng-repeat="obj in DATA.objects | orderBy:objectsOrder track by $index ">
<div ng-click="setCurrent($event, obj, '{{'obj_nav_' + $index}}')">
<img ng-src="{{formatURL(obj.Id, obj.img.fileName)}}"></img>
<div>
<p ng-bind="obj.name"/>
<p ng-bind="obj.address"/>
</div>
</div>
</div>
formatURL is a scope function that format the URL to get images, for instance the formatted url will be "https://user1:mdp@mydomain.com/objId/imageName".
Here is the error:
Error: A security issue has occurred.
at Aa (http://192.168.9.97/web/app/lib/angular/angular.min.js:147:46) at Anonymous function (http://192.168.9.97/web/app/lib/angular/angular.min.js:137:142) at Z.prototype.$set (http://192.168.9.97/web/app/lib/angular/angular.min.js:76:149) at Anonymous function (http://192.168.9.97/web/app/lib/angular/angular.min.js:242:344) at Anonymous function (http://192.168.9.97/web/app/lib/angular/angular.min.js:77:72) at m (http://192.168.9.97/web/app/lib/angular/angular.min.js:7:320) at Z.prototype.$set (http://192.168.9.97/web/app/lib/angular/angular.min.js:77:49) at Anonymous function (http://192.168.9.97/web/app/lib/angular/angular.min.js:71:500) at Anonymous function (http://192.168.9.97/web/app/lib/angular/angular.min.js:95:444) at Anonymous function (http://192.168.9.97/web/app/lib/angular/angular.min.js:128:156)
This error message was thrown using Angularjs 1.4.7. Note that I was using 1.3.0-rc5 when I first faced the problem then I update Angular but still got the same problem. I got exactly the same error in Edge.
回答1:
I finally found the answer here Microsoft. Microsoft doesn't allow user to use http://login:password@url format to prevent hidden url.
来源:https://stackoverflow.com/questions/33411507/angularjs-with-internet-explorer-11-security-issue