I am working on angularJS where my codes are fine but i am stuck at one place where i cant find why extra quotes are required in ng-class-even
directive.
In this line <tr ng-repeat="x in records" ng-class-even='"striped"'>
why striped is written like this "'striped'"
instead of this "striped"
.striped {
color:white;
background-color:black;
}
<body ng-app="myApp">
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<table ng-controller="myCtrl">
<tr ng-repeat="x in records" ng-class-even="'striped'">
<td>{{x.Name}}</td>
<td>{{x.Country}}</td>
</tr>
</table>
<script>
var app = angular.module("myApp", []);
app.controller("myCtrl", function($scope) {
$scope.records = [
{
"Name" : "Alfreds Futterkiste",
"Country" : "Germany"
},
{
"Name" : "Berglunds snabbköp",
"Country" : "Sweden"
},
{
"Name" : "Centro comercial Moctezuma",
"Country" : "Mexico"
},
{
"Name" : "Ernst Handel",
"Country" : "Austria"
}
]
});
</script>
</body>