Closed davestewart closed 5 years ago
I'm an idiot!
I thought models were populating themselves, but actually I was loading the first level of sites in the initial client
call, but (because I had forgotten this) so I had assumed that nested resources were automatically loaded.
Just teething issues :)
I gotta say, I'm loving
HalResource
models and@HalProperty
decorators! Amazing stuff, well done.However, I've found model population and loading to be a big hit and miss, I assume, because of 1) my coding but possibly 2) the data.
I had a hierarchy loading well, but it now seems to have stopped loading at
appData
(I am aliasing this in the model decorator):The JSON / class mapping is:
The site data is:
The link
site > _embed:companies[] > _link:apps
is supposed to load:I assume I need a model class for every link and every embed?
It seems that if I match the data hierarchy wrong, a model will be instantiated but with everything
undefined
.I'm pretty sure at some point I had the Apps loading.
My hunch is that the lib is getting confused as there are two consecutive
apps
keys.Is there any way to debug a model as it populates?