I have the following component:
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
@Component({
selector: 'app-button',
styleUrls: ['./button.component.scss'],
template: `
<ion-button color="{{color}}" (click)="action.emit(null)" [disabled]="condition">
{{title}}
</ion-button>
`
})
export class ButtonComponent implements OnInit {
@Input() public title: string;
@Input() public color = 'primary';
@Input() public condition: any;
@Output() public action = new EventEmitter();
constructor() { }
ngOnInit() {
}
}
But when I pass the boolean out of it it does not render, because I have a boolean that starts false and becomes true according to the input.
edit: the problem is when validDocument becomes true, the button does not render again and remains disabled.
HTML declaration:
<app-button title="Buscar" (action)="go()" condition="!validDocument"></app-button>