angular-seed
angular-seed copied to clipboard
Additions to enable navigation highlighting
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
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.
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
Seeing usage of $location and insitu views would be good.