у меня есть это в моей директиве, названный 'BGCOLOR':проверка Angular2 ElementRef nativeElement если элемент отключен
export class BgColorDirective {
constructor(el: ElementRef) {
console.log(el.nativeElement.disabled); // show "false"
if (el.nativeElement.disabled) {
el.nativeElement.style.backgroundColor = '#5789D8';
el.nativeElement.style.color = '#FFFFFF';
}
}
В моем шаблоне, у меня есть:
<button (click)="submitData()" [disabled]="true" bgcolor [routerLink]="['Onboarding']"> </button>
Я не understant почему el.nativeElement.disabled
возвращает false