My download() only passes to btnAction() when I include a debugger statement.
If I remove the debugger, it no longer passes to btnAction():
download(helpAction, modal) {
if(this.component === 'templateComponent')
debugger
this.templateComponent.btnAction(helpAction, modal);
}
btnAction(action, modal) {
this.page.action = action;
this.page.helpAction = action;
this.modal = modal;
let dto = serializeForm(this.dynForm.form.value, this.dynForm.fieldsDates);
this.submit(dto);
}
And this the HTML:
<div class="form-group" [formGroup]="group" *ngIf="!field.hidden">
<label [for]="field.name">{{ field.label }}
<span *ngIf="required()" class="danger">*</span>
<a *ngIf="field.help && field.helpAction" href="javascript:;"
(click)="download(field.helpAction, modal)">
<i class="icon-question"></i>
</a>
</label>
<ng-select #select [items]="field.options" [bindLabel]="field.name"
placeholder="Selecione..." [formControlName]="field.name"
[readonly]="field.readonly" (change)="field.action ?
onSelect(field.name, field.action, $event) : null"
[style]="field.style" [ngClass]="field.class"
(close)="select.blur(); select.focus();">
</ng-select>
<ng-container *ngFor="let validation of field.validations">
<small *ngIf="group.get(field.name)?.hasError(validation.name)"
class="form-text text-muted danger">{{ validation.message }}
</small>
</ng-container>
</div>