Protected function that requires authentication


I have a public listing page, with a “like” button.

If clicking the “like” button without logged in, I want to pop-up a ng-modal login page for user to login (or registration) before running the rest of the “like” function.

Is there any example in codepen that I can refer to?

Thanks in advance!



Found this which is very useful: