aboutsummaryrefslogtreecommitdiffstats
path: root/docs/src/templates/docs.js
diff options
context:
space:
mode:
authorMisko Hevery2011-02-03 15:21:34 -0800
committerMisko Hevery2011-02-03 20:03:38 -0800
commit882f412d578e4f01394847fa5fde21b6b4096de2 (patch)
tree2d62877e0c00a5117ae3988172e630b1af9c10e5 /docs/src/templates/docs.js
parent0d4def68ae0d95dd106d2731d60b6d6b635b5afc (diff)
downloadangular.js-882f412d578e4f01394847fa5fde21b6b4096de2.tar.bz2
Added remainder of the cookbook
Diffstat (limited to 'docs/src/templates/docs.js')
-rw-r--r--docs/src/templates/docs.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/docs/src/templates/docs.js b/docs/src/templates/docs.js
index e244bc7e..9483496e 100644
--- a/docs/src/templates/docs.js
+++ b/docs/src/templates/docs.js
@@ -1,11 +1,15 @@
+var HAS_HASH = /#/;
DocsController.$inject = ['$location', '$browser', '$window'];
function DocsController($location, $browser, $window) {
this.pages = NG_PAGES;
window.$root = this.$root;
this.$location = $location;
- this.$watch('$location.hashPath', function(hashPath){
- hashPath = hashPath || '!angular';
+ if (!HAS_HASH.test($location.href)) {
+ $location.hashPath = '!angular';
+ }
+
+ this.$watch('$location.hashPath', function(hashPath) {
if (hashPath.match(/^!/)) {
this.partialId = hashPath.substring(1);
this.partialTitle = (angular.Array.filter(NG_PAGES, {id:this.partialId})[0]||{}).name;