Please helpe me, I want to show an html element if user is admin else hide the element,
Example:
AngularJS:
$http.get('users.json'})
.success(function(data){
//data user return true and the value true represents admin
$scope.user = data.user;
});
HTML:
<h1 ng-show="user">Hello Admin</h1>
The problem here, anyone can open firebug or devTools and change user scope value.
Hello Adminis not exactly what he is going to implement in the real app. It is going to be much more. (Admin stuff)whats-insideis protected by the backend here. The attempt is to make a full client side app, and my solution below suggests that OP switches to an architecture where the admin stuff IS protected by the backend :)