我看到很多问题,看起来像重复,但我没有看到我需要从他们。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>
任何明显我缺少什么?