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

Associations are not two-way binding #11

Open
iDVB opened this issue Jul 17, 2014 · 5 comments
Open

Associations are not two-way binding #11

iDVB opened this issue Jul 17, 2014 · 5 comments

Comments

@iDVB
Copy link
Contributor

iDVB commented Jul 17, 2014

If I have something like

tree.rings

and I...

$sailsBind.bind("tree", $scope)

The trees are two-way binding, but the rings are not.

@diegopamio
Copy link
Owner

You're right, even though this service was made for sailsjs 0.10, I didn't consider the binding of associations... let me think you that could be accomplished. Or if you have any starting idea, drop it here.

@artur-krueger
Copy link
Contributor

My experience was that it's quite difficult to work with populated data in conjuction with two way data binding. In order to change the associated object the populated data must be overwritten with the new Id.

tree.rings.Id = 1 // wrong
tree.rings = 1 // ok

My solution was to deactivate popolation, bind the needed associated models also and to lookup the associated data by using an own angular filter whenever needed

@iDVB
Copy link
Contributor Author

iDVB commented Aug 30, 2014

@artur-krueger Do you have any plunkr or any code you can paste in here to show how this can be done? Not sure what you mean about changing the associated object. Also, what do you mean about "looking up data by using an own angular filter"?

@avimar
Copy link

avimar commented Nov 21, 2014

The associations show up as a model, but they aren't updateable.
Are there any plans for this?
Is there a way to turn off the "populate", just get the ID, and look them up separately?

@diegopamio
Copy link
Owner

mmmm... so, the sails-angular-bind plugin should do the "off" over population of associated models?

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

No branches or pull requests

4 participants