2017-09-11 8 views
0

angularjsを初めて使用しています。私のようなテーブルを持っている -angle-jsのIDを使用してテーブルの行を強調表示します

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> 

だから、今、私はback-endから来ているIDを持っています。私はid is 1の行を強調したいと思います。 Temporary Id is the ID here

表のデータは次のようである -

Sr.Noの文書スコアQuickScoreアクション 1 ABC 12 5 AAここ

、IDが1が、私は、行を強調したいときに。誰か私にそれについてのアイデアをくれませんか?助けてくれてありがとう。

+0

にCSSクラスを追加するためにngClass directiveを使用することができますのために強調表示することができる何かを強調表示したい行のコールを設定する必要がありますidが1のng-classを追加します。例ng-class = "{'highlighterClass':file.id == 1}";あなたのケースでは、 –

答えて

0

実際の強調表示は、CSSを使用して行う必要があります。したがって、あなたの角度は、コードが単にあなたがCSSコードを理解し、あなたが

1

あなたは<TR>

<tr ng-repeat="file in processResumeFiles" ng-class="{'highlighterClass' : file.temporaryId == 1}"> 
関連する問題