2017-09-11 2 views
0

Ich bin neu in angularjs. Ich habe eine Tabelle, die wie ist -Markieren Sie eine Zeile einer Tabelle mit der ID in Winkel-js

HTML

<table class="table table-striped" id="manageResumeTable"> 
    <thead class="text-center text-info text-capitalize"> 
     <th class="text-center col-xs-1">Sr.No.</th> 
     <th class="text-center col-xs-4">Document</th> 
     <th class="text-center col-xs-1">Score</th> 
     <th class="text-center col-xs-1">QuickScore</th> 
     <th class="text-center col-xs-5">Actions</th> 
    </thead> 
    <tr ng-repeat="file in processResumeFiles"> 
     <td class="text-center col-xs-1">{{ file.temporaryId }}</td> 
     <td class="view-orphan uploadResumeTableCellOverFlow col-xs-4"> 
      {{ file.attributes.name }} 
     </td> 
     <td class="text-center col-xs-1">{{file.totalScore}}</td> 
     <td class="text-center col-xs-1">{{file.attributes.quickScore}}</td> 
     <td class="text-center col-xs-5"> 
      <button class="btn btn-labeled btn-info" title="Annotate Un-annotated Words" ng-disabled="!file.attributes.isUploadedDocument" data-ng-click="getOrphans($index)"> 
        <i class="fa fa-eye" aria-hidden="true"></i> 
       </button> 
      <button class="btn btn-labeled btn-info" title="Promote to Gold Standard" ng-disabled="!file.attributes.isCommitted || !file.attributes.isUploadedDocument" data-ng-click="markAsGoldStd(file.attributes.name)"> 
        <i class="fa fa-share" aria-hidden="true"></i> 
       </button> 
      <button class="btn btn-labeled btn-info" title="Delete from Corpus" data-ng-click="deleteResume(file.attributes.name)"> 
        <i class="fa fa-trash" aria-hidden="true"></i> 
       </button> 
      <button class="btn btn-labeled btn-info" title="Move to Archive" ng-disabled="!file.attributes.isCommitted || !file.attributes.isUploadedDocument" data-ng-click="moveToSolar(file.attributes.name)"> 
        <i class="fa fa-sign-out" aria-hidden="true"></i> 
       </button> 
      <button class="btn btn-labeled btn-info" title="Add to Tracker" ng-disabled="!file.attributes.isCommitted || !isjdDeleted || !jdSelected" 
        data-ng-click="moveToJobDescription(file.attributes.name)"> 
        <i class="fa fa-check-square" aria-hidden="true"></i> 
       </button> 
     </td> 
    </tr> 
</table> 

So, jetzt habe ich eine ID haben, die von einem back-end kommt. Ich möchte eine Zeile markieren, deren id is 1. Temporary Id is the ID here.

Tabellendaten ist wie -

Sr.No Dokument Score Quicks Aktionen 1 abc 12 5 aa

Wenn hier die ID ist 1 dann habe ich die Zeile markieren möchten. Kann mir bitte irgendwer eine Idee geben? Danke für die Hilfe.

+0

hinzufügen füge ng-class hinzu, deren id eins ist. Beispiel ng-class = "{'highlighterClass': file.id == 1}"; .In Ihrem Fall –

Antwort

0

Die eigentliche Hervorhebung sollte über CSS erfolgen. Deshalb ist ihr Winkel ist Code einfach den Anruf Sie setzen soll auf der Reihe zu etwas hervorzuheben, dass der CSS-Code verstehen kann, und markieren Sie

1

Sie ngClass directive können Sie eine CSS-Klasse <TR>

<tr ng-repeat="file in processResumeFiles" ng-class="{'highlighterClass' : file.temporaryId == 1}"> 
Verwandte Themen