We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In 'normal' ember, when when the first property of a concatenated set of properties returns an 'undefined', the total get returns an 'undefined'.
@get('first.second')
When I use emberscript for this:
@first.second
it is compiled into:
return get$(get$(this, 'first'), 'second');
This raises an error
Cannot call get with 'second' on an undefined object.
The text was updated successfully, but these errors were encountered:
So I am slightly torn on this one. My personal preference is to use the ?. operator if you want soaked property access. What if instead the following:
?.
@first?.second
Compiled into:
this.get('first.second')
Thoughts?
Sorry, something went wrong.
How would that work on an extended concatenation like:
this.get('first.second.third')
@first?.second?.third if you wanted all the access to be soaked.
@first?.second?.third
Have you considered always soaking unless you use the * operator? I haven't really looked into it, but ut seems Ember.set & Ember.get can handle this.
@first.second.third
would compile into:
get$(this, 'first.second.third')
and
@first*.second.third
this.first.get$(second, 'third')
@first*.second*.third
this.first.third
No branches or pull requests
In 'normal' ember, when when the first property of a concatenated set of properties returns an 'undefined', the total get returns an 'undefined'.
When I use emberscript for this:
it is compiled into:
This raises an error
The text was updated successfully, but these errors were encountered: