I am new to angular js . I have used ng-class.here,
ng-class="[{'highlighter-row-Class' : (file.id == 1 && file.processed),
'bold-row-Class' : lastSelectedResumeId == file.attributes.name,
'failed-doc': !file.processed }, getClassForHrms(file)]"
css
.missingfieldspresent {
color: red;
}
.documentduplicate {
color: purple;
}
.documentuploadfailed {
color: deeppink;
}
Function
$scope.getClassForHrms = function (file) {
if (file.attributes.hrmsMandatoryFieldsMissing) {
return "missingfieldspresent";
} else if (file.attributes.isDocumentDuplicated) {
return "documentduplicate";
} else if (!file.attributes.isDocumentDuplicated) {
return "documentuploadfailed";
}
};
Rendered Html
<tr ng-repeat="file in processResumeFiles" ng-class="[{'highlighter-row-Class' : (file.id == 1 && file.processed),
'bold-row-Class' : lastSelectedResumeId == file.attributes.name,
'failed-doc': !file.processed }, getClassForHrms(file)]"
class="ng-scope [object Object] documentduplicate">
Now, Here what is happening it is taking the object so, that class is not getting added. Is there any way to use that class .
How can I do this ?