Angularjs ng样式不适用于布尔in<;的原因是什么;td>;?
尝试了以下标记:Angularjs ng样式不适用于布尔in<;的原因是什么;td>;?,angularjs,Angularjs,尝试了以下标记: `<td ng-style="isTrue && {'background-color':'yellow'}">` ` 如果单元格值为true,但代码不起作用,我将尝试以黄色突出显示。原因可能是什么 请记住,ng样式是AngularJS属性。你应该这样做: angular.module('app',[]).controller('myctrl',function($scope){ $scope.isTrue=true; }); div[
`<td ng-style="isTrue && {'background-color':'yellow'}">`
`
如果单元格值为true,但代码不起作用,我将尝试以黄色突出显示。原因可能是什么 请记住,ng样式是AngularJS属性。你应该这样做:
angular.module('app',[]).controller('myctrl',function($scope){
$scope.isTrue=true;
});代码>
div[ng样式]{
宽度:150px;
高度:150像素;
}
HTML中没有ng style
属性。如果你使用的是angular,那么把你的问题标记为angular。使用类似的方法。。但不适用于Booleanng样式,因为它的模型类似于{'property':'value'}。就像我那样,是吗?”黄色“:“红色”表达式将根据isTrue值返回“黄色”或“红色”。“背景色”将得到表达式的结果。谢谢。我只是错过了一些东西