10

我在工作angular js时遇到问题ie 11

类型错误:在严格模式下不允许在链接(angular.js:7079:34)ves-min.js:490:7处的链接( angular.js :7079:34 )处分配给只读属性Anonymous functionenter code herenodeLinkFn (angular.js:6677:13)compositeLinkFn (angular.js:6071:13publicLinkFn (angular.js:5967:30)(angular-route.js:919:7)boundTranscludeFn (angular.js:6091:9)

请帮我解决一下,谢谢。

4

2 回答 2

14

在你的 head 标签中添加这一行并刷新,当它会要求“允许阻止内容”时,单击“是”。

<meta http-equiv="X-UA-Compatible" content="IE=11" />
于 2016-03-01T07:16:36.437 回答
11

可能是以下问题:

AngularJS 控制器和“使用严格”

也许只是 IE 11 尊重严格模式,这意味着如果您执行以下操作:

(function () {
    "use strict";

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

}());

webAddressController函数不在 Angular 选择的全局范围内(使用自执行语法的目的是避免向全局范围添加内容)。

因此,您可能想尝试以下方法:

(function (angular) {
    "use strict";

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

}(window.angular));​
于 2014-12-08T05:09:28.933 回答