Reputation: 486
I only want to show specific navigation points (profile, friends) when the current state is not the state "landing". Im using AngularJS together with ui-router, if i do the following, it doesn't seem to work:
ng-hide="$state == 'landing'"
Any suggestions on how to ask for the state in ng-show / ng-hide?
Upvotes: 0
Views: 302
Reputation: 47
Use $state.includes('landing')
in your js. It defines current state.
For example:
if($state.includes('landing')){
$scope.hide = true;
}
Then in your HTML :
ng-hide = "hide";
Upvotes: 1
Reputation: 1123
This should solve your issue
<div ng-hide="$state.current.name == 'landing'"> </div>
Upvotes: 0