-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Enable multiple dynamic keys with {{get}} #12263
Comments
Nested |
@rwjblue im curious why the path variation is disallowed . |
@rwjblue It just seems like it would be a nice shorthand for deep key paths. And it just reads better, no? There is just something about nested gets, even using the concat option, that makes by brain go "ick". And the multiple params just seems logical to me. Perhaps others feel differently. |
@rwjblue I don't like this (get should act like Ember.get) but on the other hand, this is something that's easy to ast-transform if we have a better solution in the future. |
@mmun So |
The same as? |
What do you use the |
@btecu The
From what I've heard it's typically used when dealing with polymorphic models. Often with dynamic forms. |
@mmun So, re-reading everything, sounds like you feel it should at least support |
@Panman8201 If that doesn't work I am sad. It should! Forget about the AST transform, I misunderstood the problem. We both agree that |
@mmun - I believe @Panman8201 mentioned this in the intro description, but we currently disallow the key to include a period. See https://github.com/emberjs/ember.js/blob/v2.1.0-beta.2/packages/ember-htmlbars/lib/keywords/get.js#L123. |
Is it as simple as removing that assert? I don't see anything else holding back periods. As for multiple dynamic keys, could that all be handled in the
That would allow for either |
Should be fully addressed by #12323. |
Currently, I believe the
{{get}}
helper is limited to one dynamic key.I have a case where there are multiple dynamic keys in a path. Eg:
foo.bar.baz
The current workaround is to use multiple, nested "get's".What I propose is that the get helper use the remaining params as individual keys.
It almost acts like a concat helper, but that is not allowed in the current implementation.
The text was updated successfully, but these errors were encountered: