0

This is my angular html code.

 <tr *ngFor="let asset of myRequestResumeList">


            <td class="asset-properties">{{asset.userId}}</td>

            <td class="asset-properties">{{asset.requestDetails}}</td>

            <td class="asset-properties">{{asset.requestResumeAssetId}}</td>
            <td>
              <form>

                <div>
                  <button (click)="updateAuthentication(asset.userId, asset.requestDetails, asset.requestResumeAssetId, '인증' );" type="submit">승인</button>
                  <button (click)="revokeRequestUser(asset.requestResumeAssetId);" type="submit">거부</button>
                </div>
              </form>
            </td>


          </tr>

when button(updateAuthentication) is clicked, asset matched asset.userId is deleted from myRequestResumeList.

updateAuthentication function is completed.

but deleted asset is Remain in angular page.

I want to see changed page without webrowser refresh button.

I study about ChangeData(Ng zone) but It's to hard to me. I don't know how to apply Ng zone to my code.

please give me advice(easy way) to see changed page immediately

a bc
  • 43
  • 1
  • 1
  • 7

1 Answers1

0

Add *ngIf="asset.userId"

<td class="asset-properties" *ngIf="asset.userId">{{asset.userId}}</td>

But adding ngIf on td will break your table , so use a span inside td , like <td><span *ngIf="asset.userId"> {{asset.userId}}</span></td>

EDIT

The problem was that OP was not receiving the updated object in response from the server, so that resulted in view not getting updated.

BeeBee8
  • 2,944
  • 1
  • 27
  • 39
  • I try to your advice. but, page is not changed. only webBrowser refresh button provide changed page. – a bc May 19 '18 at 08:51
  • @abc How you are changing your object? I mean how do delete asset.userId? Try console log after you do that and see if that is actually being deleted from object – BeeBee8 May 19 '18 at 08:54
  • thank you, after recheck, when button is clicked, rest-server's data is changed. but I do not receive again myRequestResumeList from rest-server – a bc May 19 '18 at 09:49
  • @abc So everything will work as expected on client when you send updated object in the response from server? – BeeBee8 May 19 '18 at 09:51