我看到很多問題,看起來像重複,但我沒有看到我需要從他們。ng禁用按鈕功能永遠不會被調用
所以我有一個角狀的部件:
@Component({
providers: [
FlowsheetService,
SubscriptionService
],
moduleId: module.id,
selector: 'flowsheet',
templateUrl: './flowsheet.component.html',
styleUrls: ['i-o-renderer.css'],
encapsulation: ViewEncapsulation.None
})
它實現了一個返回boolean值的公共職能。
public ableToRetrieveHistoricalData() {
return true;
}
上述函數永遠不會被調用,但按鈕點擊函數被調用。
的HML頁:
<div>
<div style="height: 10%; padding: 10px;">
<span style="padding-left: 50px;">
<button (click)="retrieveHistoricalData()" ng-disabled="ableToRetrieveHistoricalData()"> << Previous</button>
</span>
</div>
</div>
任何明顯我缺少什麼?