diff --git a/lib/app/js/app.js b/lib/app/js/app.js index da01be45..cf2d2ab0 100644 --- a/lib/app/js/app.js +++ b/lib/app/js/app.js @@ -19,7 +19,7 @@ angular.module('sgApp', [ controller: 'MainCtrl' }) .state('app.index.overview', { - url: '/overview', + url: '/', templateUrl: 'overview.html', controller: function($rootScope, Styleguide) { $rootScope.currentSection = 'overview'; @@ -39,7 +39,7 @@ angular.module('sgApp', [ } }) .state('app.index.section', { - url: '/:section', + url: '/section/:section', templateUrl: 'views/sections.html', controller: 'SectionsCtrl', resolve: { @@ -63,7 +63,7 @@ angular.module('sgApp', [ } }) .state('app.fullscreen', { - url: '/:section/fullscreen', + url: '/section/:section/fullscreen', templateUrl: 'views/element-fullscreen.html', controller: 'ElementCtrl', resolve: { @@ -73,6 +73,9 @@ angular.module('sgApp', [ } } } + }).state('app.index.404', { + url: '/:all', + templateUrl: 'views/404.html' }); $locationProvider.html5Mode(true); diff --git a/lib/app/js/controllers/main.js b/lib/app/js/controllers/main.js index 74b2ea6f..db579116 100644 --- a/lib/app/js/controllers/main.js +++ b/lib/app/js/controllers/main.js @@ -35,7 +35,7 @@ angular.module('sgApp') // Change route to /all when searching $scope.$watch('search.$', function(newVal) { if (newVal && newVal.length > 0) { - $location.url('all'); + $state.go('app.index.section', {section: 'all'}); } }); diff --git a/lib/app/views/404.html b/lib/app/views/404.html new file mode 100644 index 00000000..12a88895 --- /dev/null +++ b/lib/app/views/404.html @@ -0,0 +1 @@ +
Page not found
\ No newline at end of file diff --git a/lib/app/views/main.html b/lib/app/views/main.html index 1c762059..bdbd4013 100644 --- a/lib/app/views/main.html +++ b/lib/app/views/main.html @@ -35,7 +35,7 @@