I make dynamic menu based on angular.js
I want show menu two ways. one is before login, other is after login
my menu code is here
navbar.js
$scope.menu = [{
'title': 'Home',
'link': '/'
},
{
'title': 'About',
'link': '/about'
},
{
'title': 'Contact',
'link': '/contact'
},
{
'title': 'Workspace',
'link': '/workspace'
},
{
'title': 'SignIn',
'link': '/signin'
}
];
...
and my html file is here
<ul class="nav nav-pills pull-right">
<li ng-repeat="item in menu" ng-class="{active: isActive(item.link)}">
<a ng-href="{{item.link}}">{{item.title}}</a>
</li>
</ul>
I want add signout menu, and only show after login. how I solve this problem?