Famous / famous-angular

Bring structure to your Famo.us apps with the power of AngularJS. Famo.us/Angular integrates seamlessly with existing Angular and Famo.us apps.
https://famo.us/angular
Mozilla Public License 2.0
1.92k stars 275 forks source link

No simple solution to getAbsolutePosition() of a scrollview (temp solution in comment) #276

Closed CharlesVoita closed 9 years ago

CharlesVoita commented 9 years ago

The only way I could solve this is by doing the following:

-($famous.find('#scrollView')[0].renderNode._displacement);

Edit: Did not have proper snippet

zackbrown commented 9 years ago

Hey @CharlesVoita — there is a library function available for digging out a reference to a F/A element's isolate object. See http://famo.us/integrations/angular/docs/unstable/api/provider/$famousProvider/index.html#find

So the whole lookup could look like $famous.find('#yourScrollView')[0].renderNode. getAbsolutePosition(). Note that like vanilla Angular, DOM lookups like this will need to occur after linking is complete, e.g. in a directive postLink function.

pasine commented 9 years ago

I had the same problem and solved using this solution. https://github.com/Famous/famous-angular/issues/238

CharlesVoita commented 9 years ago

Apologies, I am using $famous.find(). I thought I updated my code but I didn't. I did not know I could call the functions from 'renderNode', thank you!