Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You could listen for the <code>$locationChangeStart</code> or <code>$locationChangeSuccess</code> events in your header controller and then hide it based on the change in the url.</p> <p><a href="http://docs.angularjs.org/api/ng" rel="nofollow">http://docs.angularjs.org/api/ng</a>.$location</p> <p>From the AngularJS API Docs</p> <pre><code>$locationChangeStart Broadcasted before a URL will change. This change can be prevented by calling preventDefault method of the event. See ng.$rootScope.Scope#$on for more details about event object. Upon successful change $locationChangeSuccess is fired. Type: broadcast Target: root scope Parameters Param Type Details angularEvent Object Synthetic event object. newUrl: string New URL oldUrl: (optional) string URL that was before it was changed. </code></pre> <p><strong>EDIT</strong></p> <pre><code>angular.module('myApp',[]).config(['$routeProvider',function($routeProvider){ // application routes here }).run(['$rootScope','$location',function($rootScope,$location){ $rootScope.$on('$locationChangeStart',function(evt,newPath,oldPath){ switch(newPath){ case '/some/path': case '/some/other/path': case '/some/more/paths': $rootScope.$broadcast('header.hide'); break; default: $rootScope.$broadcast('header.show'); break; } }); }]) .controller('HeaderCtrlr',['$scope',function($scope){ $scope.hideFlag = false; $scope.$on('header.hide',function(){ $scope.hideFlag = true; }); $scope.$on('header.show',function(){ $scope.hideFlag = false; }); }]); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload