Angular [disabled]="MyBoolean" not working
Try [attr.disabled]="freitag? true : null"
or [attr.readonly]="freitag"
instead.
You are able to use attributes like [class.btn-lg]="someValue"
in a similar way.
Your textbox works because of this:
The disabled attribute is another peculiar example. A button's disabled property is false by default so the button is enabled. When you add the disabled attribute, its presence alone initializes the button's disabled property to true so the button is disabled.
Adding and removing the disabled attribute disables and enables the button. The value of the attribute is irrelevant, which is why you cannot enable a button by writing
<button disabled="false">Still Disabled</button>
.
from https://angular.io/guide/template-syntax
Try this, trust me it's working..
<input [disabled]="isLoading ? true : null" />
Use null
instead of false
Reactive forms don't support native 'disabled' attribute. If you want them to work the way you wanted, try exploring this : https://netbasal.com/disabling-form-controls-when-working-with-reactive-forms-in-angular-549dd7b42110
Also see Angular reactive forms doc to do something like this in form control.
Eg: new FormControl({value:'tom', disabled: true})
Reactive Forms:
.html file:
<textarea class="form-control" rows="4" formControlName="message" [readonly]="disableMessage"></textarea>
.ts file:
disableMessage = true;