Definition and Usage
The ng-style directive adds a style attribute to HTML elements.
The value of the ng-style attribute must be an object, and the expression returned is also an object
example
<body ng-app="myApp" ng-controller="myCtrl">
<h1 ng-style="myObj">stupider你好!</h1>
<script>
var app = angular.module("myApp", []);
app.controller("myCtrl", function($scope) {
$scope.myObj =
{
"color" : "white",
"background-color" : "coral",
"font-size" : "60px",
"padding" : "50px"
}
});
</script>
</body>