gkalpak/angular.js — pull request #1 by petebacondarwin (2014-10-02 11:24:30+00:00)
Title: WIP: simplify $anchorScroll offset feature

Hi @gkalpak
I had a chat with Igor last night about this. He agreed that we should go ahead and implement your solution.
I did a bit of simplification of the feature in this PR. Obviously it is not complete with tests and docs but I think that it is easier to maintain and use in this form. Apart from anything it makes writing the directive to make use of it trivial!

I don't think we need to expose a new constant, since we can just hang the offset as a property off the `$anchorScroll` service.

We need to be aware that in the future we may need to support horizontal scrolling too so I changed the name to `scroll.yOffset` so that we could add in `xOffset` if required in the future without a breaking change.

I see what you mean about multiple scrolling containers. A comprehensive solution would handle this by additional properties and directives to define the scroll container for any anchor but I believe that for this release we should not try to support this but instead just document that we only scroll the main window.

I didn't quite see what your extra fix to do with items towards the bottom of the page did. It might have been a result of your specific implementation of the offset scrolling. In this modified version items towards the bottom of the page seem to be scrolled to OK. For instance try http://localhost:8000/build/docs/api/ng/service/$animate#setClass

I just noticed that my version breaks on travis - scrollBy doesn't exist on FF and IE... I will take a look now.

Do you want to review these changes, then if you are happy, knock up some tests and docs for this new feature? The aim is to get it into the next RC release, due on 6th October. If you haven't the time then I am happy to move it forward.