dotJEM / angular-routing

Enhanced state based routing for Angular applications!
https://dotjem.github.io/angular-routing/
MIT License
75 stars 9 forks source link

Improve $scroll and jemAnchorDirective #41

Open jeme opened 11 years ago

jeme commented 11 years ago

https://github.com/dotJEM/angular-routing/issues/15 gave an initial implementation for scrolling that relies on an directive on element so scroll to that element.

This is due to the fact that it will be hard to determine when elements are loaded from a "state" perspective and even from a "view" perspective. Therefore it was necessary to provide scrolling at the right time (after DOM loading/rendering).

However, right now we could have duplicated anchors etc. causing for some unpredictable behavior (fairly sure it will go to the last element)

Instead we should just register these elements with the $scroll service so we can detect duplicates etc.

jeme commented 11 years ago

Example usages desired on state:

Example usages of $scroll: