Serializing data for persistence and hydrating it back upon retrieval

This all works really nicely, however, we have introduced a problem. Our MixerService provides the ability to save these compositions with all their tracks. However the tracks now contain complex objects such as Observables and even private references with getters and setters. 

When persisting data, you will often want to use JSON.stringify to serialize objects when storing them so that they can be retrieved later and hydrated into more complex models if needed.

In fact, if you were to attempt to process our TrackModel with JSON.stringify now, it would fail because you cannot stringify certain structures. So, we now need a way to serialize our data before storing it, as ...

Get NativeScript for Angular Mobile Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.