I’m experiencing a weird behaviour with the ng-click directive inside . As you can see on the CodePen, the closeModal() function is not being called. If I switch for modal.hide() it does works, but if I switch for a console.log() or alert(), it also doesn’t work. Why? How can I resolve it?