One pain point of Ember that I often hear is that the learning curve is a little steep. Because Angular is extremely popular, I’d like to introduce Ember from the perspective of an Angular developer, hopefully getting those who know Angular up and running quickly based on something you are already familiar with. Ember is a fantastic framework that I’ve grown to love coming from the Angular world myself, and you may too.
Not too long ago I wrote about Testing Serializers in Ember. The examples in the post went over testing the serialization process on responses and verifying methods like
keyForRelationship worked correctly. But what if you want to verify that data is serialized correctly when it is sent to your API? Let me show you an approach that has worked well for me.
In today’s post, I’d like to share a few ways of how you can work with nested data in Ember Data models.
When I first started working with Ember Data in the 1.X days, one of the most frustrating things was having to work with custom APIs. This wasn’t because of Ember Data but because I was new to it and there is a lot to learn. I was motivated to use Ember Data but I just couldn’t get it to work with whatever API I was using at the time. Do I massage the data in an adapter or a serializer? What is the difference between
normalize() in serializers? How do I handle related data that is nested? I had lots of questions like these. Even today I see a lot of the same questions being asked on the Ember Discussion Forum about getting Ember Data to work with custom APIs. In this post, I’d like to share a few common ways to customize serializers that others might be wanting to make as well, especially those new to the framework.