microsoft / TypeScript-Node-Starter

A reference example for TypeScript and Node with a detailed README describing how to use the two together.
MIT License
11.31k stars 2.77k forks source link

Add an example of nested models #89

Closed arthurRbr closed 6 years ago

arthurRbr commented 6 years ago

Hi,

I'm struggling to make nested models work, would you mind adding an example?

In my model, I have: child: string | UserModel

String when the child is not populated, UserModel if populated.

Now if I try to access child.email after population, I get property email does not exist.

Any idea how to fix this?

Many thanks!