From 853999de10b8fd0116f9da80af2c192a4a5fd39b Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Fri, 7 Mar 2014 19:57:39 +0000 Subject: docs(404 errors): provide a better 404 experience It is a bit rough and ready but does a better job than nothing. --- docs/app/src/docs.js | 2 +- docs/app/src/search.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'docs/app/src') diff --git a/docs/app/src/docs.js b/docs/app/src/docs.js index 5163e982..74d78136 100644 --- a/docs/app/src/docs.js +++ b/docs/app/src/docs.js @@ -87,7 +87,7 @@ angular.module('DocsController', []) breadcrumbPath += '/'; }); } else { - $scope.currentArea = null; + $scope.currentArea = NG_NAVIGATION['api']; $scope.breadcrumb = []; } }); diff --git a/docs/app/src/search.js b/docs/app/src/search.js index 9ae18ff6..49d73343 100644 --- a/docs/app/src/search.js +++ b/docs/app/src/search.js @@ -45,6 +45,10 @@ angular.module('search', []) }; }]) +.controller('Error404SearchCtrl', ['$scope', '$location', 'docsSearch', function($scope, $location, docsSearch) { + $scope.results = docsSearch($location.path().split(/[\/\.:]/).pop()); +}]) + .factory('lunrSearch', function() { return function(properties) { if (window.RUNNING_IN_NG_TEST_RUNNER) return null; -- cgit v1.2.3