This question is similar to that one Call Angular Function with Jquery
But I think mine example have small diferences.
On Angular
project I have a button:
<button id="button1" #tbName title="tbName" class="btn btn-lg btn-outline-primary" (click)="open(content,tbName.title)">Launch demo modal</button>
On TS file there is a method:
open(content, title) {
console.log(document.getElementById('button1').getAttribute('title'));
this.id_desk = document.getElementById('button1').getAttribute('title');
this.modalService.open(content, { centered: true, container: '#test', ariaLabelledBy: 'modal-basic-title' }).result.then((result) => {
this.closeResult = `Closed with: ${result}`;
}, (reason) => {
this.closeResult = `Dismissed ${this.getDismissReason(reason)}`;
});
}
How should looks like jQuery function that will directly call open(content,title)
angular method?