Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css IE11问题:用作angularJS变量的样式不';不渲染_Css_Angularjs_Internet Explorer 11 - Fatal编程技术网

Css IE11问题:用作angularJS变量的样式不';不渲染

Css IE11问题:用作angularJS变量的样式不';不渲染,css,angularjs,internet-explorer-11,Css,Angularjs,Internet Explorer 11,HTML 这是JSFIDLE 当我尝试使用variable作为样式时,它可以在Chrome和FF中使用,但是背景色(在上面提到的示例中)不适用于IE11。 感谢您的帮助。使用ng style而不是带有{{} 标记 var app = angular.module('myApp', []); app.controller('myCtrl', function($scope) { $scope.hex= "#ff0000"; }); 背景色:{{hex}} 使用ng style而不是带

HTML

这是JSFIDLE

当我尝试使用variable作为样式时,它可以在Chrome和FF中使用,但是背景色(在上面提到的示例中)不适用于IE11。
感谢您的帮助。

使用
ng style
而不是带有
{{}

标记

var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
    $scope.hex= "#ff0000";
});

背景色:{{hex}}

使用
ng style
而不是带有
{{}

标记

var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
    $scope.hex= "#ff0000";
});

背景色:{{hex}}

<div ng-app="myApp" ng-controller="myCtrl" ng-style="{'background-color':hex}">
    Background-color: {{hex}}
</div>