design-angular-kit
design-angular-kit copied to clipboard
aprire modale da typescript
come posso aprire una modale no tramite il template con (click)="exampleModal.toggle()" ma dal componente?
@ViewChild(ItModalComponent) myModal: ItModalComponent;
myModal.toggle()
e se le modali da aprire sono più di una? come le mappo?
puoi assegnare un id ad ogni modale
<it-modal #modal="itModal"></it-modal>
<it-modal #modalTest="itModal"></it-modal>
@ViewChild('modal') myModal: ItModalComponent;
@ViewChild('modalTest') myModalTest: ItModalComponent;