You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 29, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 29, 2026. It is now read-only.
Change anchor hrefs to ui-sref when using ui-router #331
When spinning up a new app w/ ui-router, I find myself having to find and change each href to ui-sref. Would be preferable to have this automatically set when using the ui-router option.
The navbar uses href, not ng-href. I find myself changing this to ui-sref in order to properly navigate to the desired $state.
Also, when logging in, login.controller calls '$location.path('/')'. I think if using ui-router, this should be something like $state.go('main') instead.
Ok, so ng-href is only for $scope.menu in navbar.controllers. The rest of the menu li's use href.
I think they both should be ui-sref if using ui-router. For example, I changed ng-href to ui-sref="main" for "Home", and obviously all the other hrefs as well (to their proper states).
Activity
remicastaing commentedon Jul 11, 2014
Is it all href or just the ng-href?
All ng-href are in the navbar files.
jpstone commentedon Jul 11, 2014
The navbar uses href, not ng-href. I find myself changing this to ui-sref in order to properly navigate to the desired $state.
Also, when logging in, login.controller calls '$location.path('/')'. I think if using ui-router, this should be something like $state.go('main') instead.
remicastaing commentedon Jul 11, 2014
I don't understand. I went through the generator and just found this:
jpstone commentedon Jul 11, 2014
Ok, so ng-href is only for $scope.menu in navbar.controllers. The rest of the menu li's use href.
I think they both should be ui-sref if using ui-router. For example, I changed ng-href to ui-sref="main" for "Home", and obviously all the other hrefs as well (to their proper states).
remicastaing commentedon Jul 15, 2014
To avoid such code in several place all over the files:
they may be better to write separate files for ui-router:
and also the four associated jade file.
In following files:
$location.path('/');may be replaced by$state.go('main'). Same thing for the cofffescript files.feat(app-routing): improve app routing
feat(app-routing): improve app routing