【发布时间】:2018-07-05 18:01:41
【问题描述】:
在我的组件中,我从我的服务中获取数据:
ngOnInit() {
this._sharedService.
getReceiptItem().takeUntil(this.ngUnsubscribe).
subscribe(products => this.receiptItems = products);
}
如果我的数组this.receiptItems 有任何项目,我该如何禁用按钮?
我尝试过这样的事情:
<div class="top-left">
<button [disabled]="receiptItems.count>0" type="button" [routerLink]="['/administration']"><i class="fas fa-bars fa-fw"></i></button>
</div>
但不知不觉这不是解决方案..
谢谢
【问题讨论】:
标签: javascript html angular css-selectors angular-services