angular-seed icon indicating copy to clipboard operation
angular-seed copied to clipboard

Additions to enable navigation highlighting

Open gobijan opened this issue 10 years ago • 3 comments

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

gobijan avatar Mar 28 '14 14:03 gobijan

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.

petebacondarwin avatar May 03 '14 19:05 petebacondarwin

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

gobijan avatar May 07 '14 09:05 gobijan

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

sodacrackers avatar Sep 18 '14 04:09 sodacrackers