aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorPeter Bacon Darwin2014-03-02 15:37:09 +0000
committerPeter Bacon Darwin2014-03-02 15:38:04 +0000
commit27b7fa3914d5375721d2e575297f0b0c35770c3f (patch)
tree67a756f223d225b9723ede409857fd88c99d5d2d /docs
parentd7ecab775ceefcd55a23780d005ce1c39cd8651b (diff)
downloadangular.js-27b7fa3914d5375721d2e575297f0b0c35770c3f.tar.bz2
docs(directives): ensure that the back-to-top directive resets location
Closes #6512 Closes #6499
Diffstat (limited to 'docs')
-rw-r--r--docs/app/src/directives.js3
-rw-r--r--docs/config/templates/indexPage.template.html2
2 files changed, 3 insertions, 2 deletions
diff --git a/docs/app/src/directives.js b/docs/app/src/directives.js
index 15bef69b..99a751c0 100644
--- a/docs/app/src/directives.js
+++ b/docs/app/src/directives.js
@@ -10,9 +10,10 @@ angular.module('directives', [])
*
* @description Ensure that the browser scrolls when the anchor is clicked
*/
-.directive('backToTop', ['$anchorScroll', function($anchorScroll) {
+.directive('backToTop', ['$anchorScroll', '$location', function($anchorScroll, $location) {
return function link(scope, element) {
element.on('click', function(event) {
+ $location.hash('');
scope.$apply($anchorScroll);
});
};
diff --git a/docs/config/templates/indexPage.template.html b/docs/config/templates/indexPage.template.html
index 28128ba0..9582c825 100644
--- a/docs/config/templates/indexPage.template.html
+++ b/docs/config/templates/indexPage.template.html
@@ -226,7 +226,7 @@
<footer class="footer">
<div class="container">
- <p class="pull-right"><a back-to-top href="#">Back to top</a></p>
+ <p class="pull-right"><a back-to-top>Back to top</a></p>
<p>
Super-powered by Google ©2010-2014