Skip to content

Instantly share code, notes, and snippets.

@hunterloftis
Created June 21, 2013 22:46
Show Gist options
  • Save hunterloftis/5834893 to your computer and use it in GitHub Desktop.
Save hunterloftis/5834893 to your computer and use it in GitHub Desktop.
angular
.module('test.routes', ['ui.state'])
.config(function($routeProvider, $stateProvider) {
// automatically redirect to #/test
$routeProvider
.otherwise({ redirectTo: '/test' });
@wbyoko
Copy link

wbyoko commented Jun 21, 2013

Questions?
do you have a '/test' route provided?
are you using ng-view?

if not, you could just use this in a main controller - inject $location

      if ($location.path() === '') {
        $location.path('/test');
      }

todomvc example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment