-1

In my website i have navigation bar in index page ( index controller).When i click the login button the state and controller will change to login controller. And i want to hide the navigation bar in login controller.

I don't want to hide navigation bar based on state change or route change.I want to hide navigation bar in login controller controller.

can you please help.thanks in advance.

  • What kind of content? Please include some relevant code and be more specific what you are trying to achieve, supported by your code. – devqon Dec 21 '16 at 12:08
  • use `ng-hide` for your specific content in specific controller to hide specific content – gaurav bhavsar Dec 21 '16 at 12:09

2 Answers2

1

In angular you can hide content in various ways for example:

<div ng-if="showMe">shown if showMe true</div> ( creates subscope, not visible in dom)
<div ng-hide="hideMe">hidden if hideMe true</div> ( no subscope, visible in dom, but not visible for user)
<div ng-class="{'displayNoneClass': hideMe}"> hidden if hideMe true</div> ( no subscope, adding just class with display: none; property
<div ng-style="hideMe"> add style to hideMe like hideMe='{display: none}' which will be embedded into inline style</div>

I have no other ideas...

Matuszew
  • 841
  • 5
  • 12
0

Javascript

 var pages = ['/'];
$rootScope.$on('$locationChangeSuccess', function() {
  var $$route = $route.current.$$route;
  $scope.contentShow = $$route && pages.indexOf($$route.originalPath) < 0;
});

HTML

<div ng-hide="contentShow">Content</div>