how to write a modal popup inside a function in angular code example Example: ways to open modal in angular document.getElementById("openModalButton").click();