Embarking on a fresh Angular 2 project centered around Photos and Users.
The backend work is all done, with the API in place. I've already constructed those classes.
Now, I find myself pondering...
To manipulate these objects on the client end, would it be better to rewrite the classes in typescript?
let photo = new Photo(1, "http://url", "Some title");
or simply stick with standard objects?
let photo = {
id: 1,
url: "http://...",
title: "Some title"
}
Which route should I take?
The first option entails duplicating the model (first on server, then on client side).
The second choice feels a bit old-fashioned, doesn't it?