Skip to content

Commit f86bcf1

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 8d28230 commit f86bcf1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/ng/anchorScrollSpec.js

+12
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,18 @@ describe('$anchorScroll', function() {
260260
addElements('id=top'),
261261
callAnchorScroll('top'),
262262
expectScrollingTo('id=top')));
263+
264+
265+
it('should scroll to element with id "7" if present, with a given hash of type number', inject(
266+
addElements('id=7'),
267+
callAnchorScroll(7),
268+
expectScrollingTo('id=7')));
269+
270+
271+
it('should scroll to element with id "7" if present, with a given hash of type string', inject(
272+
addElements('id=7'),
273+
callAnchorScroll('7'),
274+
expectScrollingTo('id=7')));
263275
});
264276
});
265277

0 commit comments

Comments
 (0)