AngularJS Assignment to read-only properties is not allowed in strict mode in ie 11

喜你入骨 提交于 2019-11-30 13:58:16

问题


I'm have problem with working angular js in ie 11

TypeError: Assignment to read-only properties is not allowed in strict mode at link (ves-min.js:490:7) at Anonymous function (angular.js:7079:34)enter code here at nodeLinkFn (angular.js:6677:13) at compositeLinkFn (angular.js:6071:13) at publicLinkFn (angular.js:5967:30) at link (angular-route.js:919:7) at boundTranscludeFn (angular.js:6091:9)

Please help me some solution, thanks.


回答1:


Add this line in your head tag and do refresh, when It will ask for "allow block content" click "yes".

<meta http-equiv="X-UA-Compatible" content="IE=11" />



回答2:


It could be the following problem:

AngularJS controllers and "use strict"

Maybe it's just that IE 11 respects strict mode, which means if you do something like:

(function () {
    "use strict";

    function webAddressController($scope, $rootScope, web_address_service) {
        // Do things
    }

}());

The webAddressControllerfunction is not in global scope for Angular to pick (the point of using the self executing syntax is to avoid adding things to global scope).

So, you might want to try something like:

(function (angular) {
    "use strict";

    angular.module('myApp').controller('webAddressController', function($scope) {
        // Do things
    });

}(window.angular));​


来源:https://stackoverflow.com/questions/27351713/angularjs-assignment-to-read-only-properties-is-not-allowed-in-strict-mode-in-ie

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!