Hi guys I have two components in angular 2 one component A where I have a button and component B where I have a registration form, now how can I validate the button in component A so that it appears when the component B submit has been successful and keep it hidden if the submit has not been executed? Note but they are two different components A and B
A component code .html
<div>
<button md-mini-fab color="warn" class="flotante mr-1" ><md-icon>add</md-icon></button>
</div>
B component code .html
<form class="pt-1" [formGroup]="altaForm" (ngSubmit)="onSubmit($event)">
<div class="pb-1">
<md-select placeholder="Seleccione un producto" id="id" formControlName="id" class="full-width" [(ngModel)]="new.idproducto">
<md-option *ngFor="let med of tools" [value]='med.id'>{{med.tool}}</md-option>
</md-select>
</div>
<div class="pb-1">
<md-form-field class="full-width">
<input mdInput type="number" min="1" name="cantidad" placeholder="Cantidad (Minimo: 1)" formControlName="cantidad">
</md-form-field>
<div class="card-title-text center">
<div class="">
<span fxFlex></span>
<button type="submit" md-mini-fab class="mat-primary" [disabled]="altaForm.invalid"><md-icon>send</md-icon></button>
</div>
</div></form>
and in the .ts of component B
onSubmit(event: Event) {
event.preventDefault();
this._addService.newTool(this.new.id, this.new.cantidad).subscribe(
(data) => {
console.log('agregado');
},
err => {
console.error(err);
},
() => {
}
);
}