【发布时间】:2020-05-14 16:20:06
【问题描述】:
我正在尝试隐藏转账按钮如果账户为负值,或者如果账户为正值则显示转账。
我想检查金额是否为负然后隐藏转账按钮如果金额为正则显示转账按钮
HTML
<div class ="content">
<span class ="negative-account" *ngIf="account?.primaryValue! <= 0">-</span>
<span class="dollar-sign">$</span>
{{account?.primaryValue | currency: '': '' | absolute }}
</div>
<div class="transfer"
*ngIf="showTransferLink"
<div> Transfer</div>
</div>
打字稿
export class AccountComponent {
private _showTransferLink = false;
@Input ()
public set showTransferLink(showTransferLink: boolean) {
this._showTransferLink = attributeToBoolean(showTransferLink);
}
public get showTransferLink() {
return (
this._showTransferLink &&
this.account
);
}
【问题讨论】:
-
能否请您提供传输按钮的 HTML 以查看您目前拥有的内容?
-
转移按钮在哪里?
-
我添加了转移按钮
标签: html angular typescript scss-lint