Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove nav menu from login page

Tags:

angularjs

Have base html admin_layout.html where i wrote this:

<body>
    <div ng-include="'/static/partials/admin_navigation.html'"></div>
    <div ng-view></div>

Interested to know how may remove admin navigation from login page?

Tryed to set variable hide_menu in LoginCtrl and hide it with ng-if="hide_menu", but this doesn`t work for me. It hide menu in all admin panel.

UPD: Fixed it adding to navigation div Menu controller. Or better create menu directive?

UPD2:

Added in admin_app.js:

adminApp.run(function($rootScope, $location) {
    $rootScope.location = $location;
});

and in admin_layout.html:

<nav ng-include="'/static/partials/admin_navigation.html'" ng-if="location.path() !== '/admin/login'"></nav>

Now everything work fine

like image 496
Luam Avatar asked Mar 03 '14 08:03

Luam


People also ask

How do I hide the login side NAV?

Our main idea to hide SideNav is by creating multiple layouts. In the following routing configuration, we have 2 parent routes configured as login and home. With login we have simply LoginComponent which will be rendered in <router-outlet> and post login main route will be rendered.

How do I hide the NavBar on certain pages?

Go to your Navbar settings and find the navigation item you want to hide for a particular page. Click to edit and assign it a classname. You could assign it something like "hide-navigation-item."


1 Answers

Fixed problem using code that i wrote in UPD2 of my question

like image 108
Luam Avatar answered Sep 25 '22 18:09

Luam