Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Additions to enable navigation highlighting #163

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gobijan
Copy link

@gobijan gobijan commented Mar 28, 2014

Additions to enable navigation highlighting

  • Added AppCtrl to tag.
  • Added AppCtrl to controllers.js.
  • Defined $scope.isActive function that takes a viewLocation and returns a boolean if it is the same as $location.path().
  • Added ng-class="{ active: isActive('/viewname')}" to ul.menu > li items.
  • Added css class .menu > li.active to highlight active navigation item with bold font.

I hope this commit will be accepted as it is a natural feature extension that almost everyone wants to use. If a router is demonstrated with navigation and partials highlighting the current active navigation item makes totally sense to me.

Cheers Bijan

Review on Reviewable

 ===========================

 - Added AppCtrl to <html> tag.
 - Added AppCtrl to controllers.js.
 - Defined $scope.isActive function that takes a viewLocation and returns a boolean if it is the same as $location.path().
 - Added ng-class="{ active: isActive('/viewname')}" to ul.menu > li items.
 - Added css class .menu > li.active to highlight active navigation item with bold font.

 I hope this commit will be accepted as it is a natural feature extension that almost everyone wants to use. If a router is demonstrated with navigation and partials highlighting the current active navigation item makes totally sense to me.

 Cheers Bijan
@petebacondarwin
Copy link
Contributor

Hi @tschundeee - thanks for this PR. The trouble is that there are quite a few ways of doing this sort of thing and angular-seed should be agnostic to this and also as simple as possible. I am not sure we should start adding features like this.

@gobijan
Copy link
Author

gobijan commented May 7, 2014

Hi Pete,
sure this depends on how much you want to add to the template. I think that from functionality point of view it totally makes sense to offer highlighting as you already have a navigation in the template. If you have a leaner solution I am also interested. I tried to implement highlighting with minimal code changes.

Cheers Bijan

@sodacrackers
Copy link

Seeing usage of $location and insitu views would be good.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
3 participants