Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fa-container-surface options #193

Closed
zoneblaze opened this issue Sep 2, 2014 · 5 comments · Fixed by #202
Closed

fa-container-surface options #193

zoneblaze opened this issue Sep 2, 2014 · 5 comments · Fixed by #202

Comments

@zoneblaze
Copy link

When I apply fa-options to a container surface, e.g. a background colour, it works initially, but if I try and assign a new colour property afterwards through the same scope object to the same container surface, the background colour doesn't change? Not sure if this is expected behaviour, can you only apply fa-options on a container surface once?

@steveblue
Copy link
Contributor

A vanilla famo.us ContainerSurface also has the ability to support "properties", which allows you to set CSS attributes. Not having this ability is blocking me from implementing something similar to a ScrollContainer with a ContainerSurface encapsulating a ScrollView.

@zackbrown
Copy link
Contributor

fa-options watching is not yet implemented on a fa-container-surface, but it's on the tracker and should come together soon. fa-options is pretty standard across Famo.us components, so we might end up breaking it out into its own directive.

Also remember that you always have the ability to manipulate the Famo.us components directly using $famous.find. Using this, you can set properties and options directly on any vanilla Famo.us components, which should keep you from getting stuck in the meantime.

@zoneblaze
Copy link
Author

Thanks for the tip. I can work with that. I just wasn't sure if that was a bug or if I was doing something wrong as usually you expect model changes to pick up in the view in Angular.

marlonpp pushed a commit to marlonpp/famous-angular that referenced this issue Sep 6, 2014
@steveblue
Copy link
Contributor

yes, so this does work

                   var container = $famous.find('.container-surface')[0].renderNode;
                   container.properties = {
                     backgroundColor: '#ABABAB'
                   };

@zackbrown
Copy link
Contributor

live fa-options updates should now work (on any Famo.us element that uses the setOptions API, which should be just about everything) without needing to use $famous.find, thanks to @marlonpp's PR #202.

One other note on $famous.find: you can use any CSS selectors, including classes, ids, or tag types to look up elements (e.g. $famous.find('#my-element')[0] or $famous.find('fa-container-surface')[0])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants