Skip to content

Commit 9b05fbc

Browse files
committed
feat($anchorScroll) Allow $anchorScroll to have a numeric input
Ref angular#14680 Before the change : <div id="7"> $anchorScroll(7); Does not work After the change : <div id="7"> $anchorScroll(7); works
1 parent cf241c4 commit 9b05fbc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/ng/anchorScroll.js

+3
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ function $AnchorScrollProvider() {
238238
}
239239

240240
function scroll(hash) {
241+
//Allow hash to be a number
242+
if(isNumber(hash)) hash = hash.toString();
243+
241244
hash = isString(hash) ? hash : $location.hash();
242245
var elm;
243246

0 commit comments

Comments
 (0)