Search code examples
angularangular6angular-ng-if

Hide same row value based on condition in angular 6?


enter image description here

code for popup,how to write *ngIf condition to hide same row group and display other group .Here i am passing and displaying group, i just need to hide respective request group. GroupRequestDesc have all group values.

 <tr>
    <td *ngFor="let value of GroupRequestDesc;let $index=index " style="padding-right: 15px;">                             
       <label for="checkbox_group2" class="checkbox cb_pad" style="width: 180px;display:inline-block;">
           <input id="checkbox_group2" type="checkbox" value="{{value.nxReqGroupId}}" (change)="checkboxVisibility(value.ReqGroupId,$event)"/><i class="skin"></i><span>{{value.nxReqGroupDesc}}</span>
       </label>
    </td>
<tr>

And here is my function through which I am passing details to the popup for display:

passReqIdforcopytogroup(nxRequestId,solutionData,groupData){
        this.ReqId = RequestId;
        this.ReqGroupId = groupData;
        this.GroupRequestDesc = groupData;
        this.SolutionId = solutionData.SolutionId;
        this.ReqGroupName = solutionData.ReqGroupName;
    }

Here what i am trying to achieve is that when i click on submit button respective request group should not display in next coming popup rest all other group should display in popup.how can i achieve that please someone help me on this. On Click of submit I am displaying popup which should display remain group


Solution

  • Here is HTML code:

      passDataToPopup(group, reqId){
        console.log(group, reqId);
        let remainingGroups = group.filter(ele=> ele.ReqId != reqId);
        console.log(remainingGroups, 'remaining reqestids of group');
    
      }
        <td>
            <button class="btn-success" 
             (click)= "passDataToPopup(groupRowData.requestDetails, requestDetailData.ReqId)">submit</button>
        </td>

    Hope it will help you.