這是怎麼了我的主機,綁定到評爲NG2-RC4的父組件「禁用」按鈕屬性:Angular2決賽:HostBinding不工作了
@Component({
selector: "nav-next",
template: `
<div class="nav-next-directive" (click)="onClick($event)">
<button color="primary" class="primary" [attr.disabled]="disabled">
<ion-spinner *ngIf="ngIf === true" icon="lines"></ion-spinner>
{{buttonTitle}}
</button>
</div>`
})
export class NavNextDirective {
@HostBinding("attr.disabled");
@Input() isValid: boolean;
這不工作了,(NGC抱怨)我現在已經在部分上述更改爲得到了一半:
@HostBinding("attr.disabled") isValid: boolean = true;
@Input() isValid: boolean;
但是NGC說:
Can't bind to 'isValid' since it isn't a known property of 'nav-next'.
1. If 'nav-next' is an Angular component and it has 'isValid' input, then verify that it is part of this module.
2. If 'nav-next' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message.
("
<ion-list>
<nav-next (click)="save()"
[ERROR ->][isValid]="goalForm.valid"
[serverWaiting]="serverWaiting"
button"): [email protected]:18
現在Hostbinding有什麼想法?