-
Notifications
You must be signed in to change notification settings - Fork 265
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
Idiomatic way to filter on nested route? #55
Comments
What about something like this for your advisor accounts route? model: function() {
this.modelFor("advisor").get("accounts").then(function(accounts) {
return accounts
}
} |
@JFickel Ah! I'm coming from using fireplace, where I had tried that and it didn't work (because it doesn't return a PromiseModel) and so I forgot to try it with emberFire. I'll comfirm and close this it if it works. |
I am curious though, for other reasons, is it something idiosyncratic about working with Firebase relationships that prevents or makes difficult implementing |
@neverfox I'm working on implementing |
@JFickel Yep, that works great. |
@aputinski Would you mind pushing your branch for implementing |
I'm trying to figure out how to do filtering on child routes with emberfire since the adapter doesn't implement findQuery. I have the following:
As you can see it currently fetches all the accounts, but what I want is only the accounts for the advisor in question. Am I supposed to pull all of the accounts into my controller and then filter there (setting the controller to also have the model for the advisor so that I can perform the filter)? That seems less than ideal, but I cannot see any other way. What I would be tempted to do in any other case would be:
This seems like a common enough scenario that I'm hoping someone will be able to provide an example of the most efficient way to do this. Note that it's imperative that the solution guarantee async resolution of all the data from Firebase before the controller starts computing anything.
The text was updated successfully, but these errors were encountered: