Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

feat($anchorScroll) Allow $anchorScroll to take a numeric input #15182

Closed
wants to merge 3 commits into from

Conversation

mrLarbi
Copy link
Contributor

@mrLarbi mrLarbi commented Sep 23, 2016

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

Feature

What is the current behavior? (You can also link to an open issue here)

Allow $anchorScroll to take a numeric input
Ref #14680

What is the new behavior (if this is a feature change)?

$anchorScroll can now take a numeric input :

$anchorScroll(7);

Does this PR introduce a breaking change?

No

Please check if the PR fulfills these requirements

Other information:

Ref #14680

Before the change :

$anchorScroll(7); Does not work

After the change :

$anchorScroll(7); works

Ref angular#14680

Before the change :

<div id="7">
$anchorScroll(7); Does not work

After the change :

<div id="7">
$anchorScroll(7); works
Ref angular#14680

Before the change :

<div id="7">
$anchorScroll(7); Does not work

After the change :

<div id="7">
$anchorScroll(7); works
@gkalpak
Copy link
Member

gkalpak commented Sep 25, 2016

Thx for the PR 👍
It looks good, but we also need at least one test (to verify the new behavior and guard against future regressions).

(Feel free to ping me when you have pushed any changes, so I can take another look.)

Ref angular#14680

Before the change :

<div id="7">
$anchorScroll(7); Does not work

After the change :

<div id="7">
$anchorScroll(7); works
@mrLarbi
Copy link
Contributor Author

mrLarbi commented Sep 25, 2016

@gkalpak Hi gkalpak !

I've added two unit tests. One to check if $anchorScroll still works with a hash of type string. And another one to test the new behavior. :)

@gkalpak
Copy link
Member

gkalpak commented Sep 30, 2016

LGTM

@gkalpak gkalpak closed this in 9062bae Sep 30, 2016
gkalpak pushed a commit that referenced this pull request Sep 30, 2016
This allows `$anchorScroll(7)` to scroll to `<div id="7">` (although technically, the target ID is a
string, not a number).

Fixes #14680

Closes #15182
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this pull request Nov 21, 2016
This allows `$anchorScroll(7)` to scroll to `<div id="7">` (although technically, the target ID is a
string, not a number).

Fixes angular#14680

Closes angular#15182
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this pull request Nov 21, 2016
This allows `$anchorScroll(7)` to scroll to `<div id="7">` (although technically, the target ID is a
string, not a number).

Fixes angular#14680

Closes angular#15182
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this pull request Nov 21, 2016
This allows `$anchorScroll(7)` to scroll to `<div id="7">` (although technically, the target ID is a
string, not a number).

Fixes angular#14680

Closes angular#15182
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this pull request Nov 21, 2016
This allows `$anchorScroll(7)` to scroll to `<div id="7">` (although technically, the target ID is a
string, not a number).

Fixes angular#14680

Closes angular#15182
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this pull request Nov 21, 2016
This allows `$anchorScroll(7)` to scroll to `<div id="7">` (although technically, the target ID is a
string, not a number).

Fixes angular#14680

Closes angular#15182
petebacondarwin pushed a commit that referenced this pull request Nov 23, 2016
This allows `$anchorScroll(7)` to scroll to `<div id="7">` (although technically, the target ID is a
string, not a number).

Fixes #14680

Closes #15182
petebacondarwin pushed a commit that referenced this pull request Nov 24, 2016
This allows `$anchorScroll(7)` to scroll to `<div id="7">` (although technically, the target ID is a
string, not a number).

Fixes #14680

Closes #15182
ellimist pushed a commit to ellimist/angular.js that referenced this pull request Mar 15, 2017
This allows `$anchorScroll(7)` to scroll to `<div id="7">` (although technically, the target ID is a
string, not a number).

Fixes angular#14680

Closes angular#15182
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants