shabenda shabenda - 1 year ago 84
AngularJS Question

Make AngularJS ng-show and ng-hide safer

In AngularJS, I want to hide an element to restrict users that are not authenticated from seeing it.

ng-hide directive is working, but when someone is opening the Developer Tools, he can change the class given to the element (ng-hide) and then he can see the content.

How can I make ng-hide more secure for authorization?

Thank's for help!!!

P.S: I'm using Node.JS for backend

Answer Source

You can use ng-if for example :

<input type='text' name='firstName' ng-if="expression" />
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download