I am trying to disable button and input-field through angular directive based on the permission. I have tried few ways but it doesn't help
if (this.permission==true) {
this.viewContainer.createEmbeddedView(this.templateRef);
} else {
const viewRootElement : HTMLElement = this.viewContainer.createEmbeddedView(
this.templateRef
).rootNodes[0];
viewRootElement.setAttribute('disabled', 'false');
}