What I do:

I have a navbar page which I ng-include in my main page

In my navbar controller I expose a currentUser object and an isAdmin 
function which returns true is the current user is an admin

$scope.currentUser = {
    name = 'Bob',
    role = 'admin'
};

$scope.isAdmin = function() {
    return $scope.currentUser && $scope.currentUser.role === 'admin';
};

In my navbar I have menu items which are only shown is the current user is 
an admin

<li ng-show="isAdmin()" <a href="/admin">Admin</a></li>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to