点击功能将显示记录。但无法隐藏记录

时间:2018-11-21 09:50:06

标签: angular html5 css3

当我单击向下箭头功能时,将显示记录;如果再次单击向下箭头功能,则应隐藏记录。但是隐藏功能不起作用。

1)如果未定义selectedAccountID,则单击功能应起作用并显示记录。

2)如果selectedAccountID未定义,则应隐藏记录

accountSelection(account) {
    if (!this.selectedAccount || account.accountId !== this.selectedAccount.accountId) {
        this.selectedAccount = account;
        this.selectedAccountTransactions = this.transactionData.unrealizedGainLossDetails.filter(acc => acc.accountId === this.selectedAccount.accountId);
        this.initialPaging();
    } else {
        this.selectedAccount = undefined;
        this.selectedAccountTransactions = undefined;
        this.unrealizedTransaction = undefined;
    }
    this.cd.detectChanges();
}
<li (click)="accountSelection(account)">
    <i _ngcontent-c2="" aria-hidden="true" class=" fa fa-caret-down"></i>
</li>

0 个答案:

没有答案