I am using the most up to date stable versions Ember/Ember Data (2.3.1)
Is it possible to get computed property values out of an Ember Object that is exposed through the DS.Snapshot Object? I do not see an easy way to get these values, and right now I am duplicating a lot of logic to extract these values.
For example, if I have an Ember Object that looks like:
Through the DS.Snapshot object that is exposed, I am able to get firstName and lastName through the snapshots attr method, but I do not see a way to get the fullName computed property. I have googled this and haven’t had much luck. Any insight would be helpful, thanks!
Can you explain what your use case is and where you’re accessing the snapshot? I think the answer to your basic question is that it’s not really possible — but, maybe there’s a different way to handle it given your use case!?
Sure, I can elaborate. We have a very non-standard api that can not be changed due to various reasons. As a result, I have to do a lot of data transformations in both Ember Data Adapters and Serializers.
This question was in regards to using various Adapter method hooks, like updateRecord and deleteRecord. Lots of custom headers go into these ajax calls. The only other way I see of handling this, is to create blank attributes for the given properties I want, and then using an observer function to set those properties, which probably the right way to do this. But just wanted to check before refactoring my existing adapters.