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

34.4k views Asked by At

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.

2

There are 2 answers

3
Meligy On

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));​
1
Shyam_coder On

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" />