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

famous-group doesn't compile classes from directive #144

Closed steveblue closed 10 years ago

steveblue commented 10 years ago

On every directive that becomes a famous-group please add the ability to class or id this div from the directive attributes so the element can be selected post compile. I'm frustrated that I can't select a group's renderNode with the $famous provider by class. Surfaces have this ability, so should groups.

steveblue commented 10 years ago

I guess this works for now...

target = $famous.find('.content-scroll-view')[0].renderNode._scroller.group._currTarget;

zackbrown commented 10 years ago

I'm not sure that I follow what you're requesting here. You should be able to access the top-level render node for any fa-directive using $famous.find, and then any children of those top-level render nodes by digging into them (just as you would need to do with vanilla Famo.us.) I.e. that's what you're doing in the snippet in your second comment.

Are you saying you would like some sort of helper function/syntactic shorthand for accessing Groups from any Famo.us element that contains one, such as a Scrollview?

steveblue commented 10 years ago

Yes, that is essentially the feature I'm requesting.

zackbrown commented 10 years ago

Given that this is a strictly Famo.us feature (not related to Angular) I'd say that it would belong in the core Famo.us library. If digging into the different widgets to retrieve Groups is too cumbersome, I would recommend opening an issue at https://github.com/Famous/famous/issues so that the core team can take a look at it. I'll go ahead and close this one here in the meantime.