With angularjs, we usually use plain HTML to write representations. Now I have a question: how can I show or hide some buttons depending on user rights?
For example, an article is displayed on the current page. If the current user is the author or article or administrator, then the "Delete" button will be displayed.
But since the view is plain HTML, how can I control it?
I can send a request to transfer some data (for example, the current user ID, article ID) to the server for verification, but if there are many buttons, I need to request many times, which is inefficient.
Is there a better way to do this?
source share