mercredi 14 mai 2014

Chaining links in ViewModel

I am binding a model record to my ViewModel using the links config. This record has a property that has an ID of another model record. I want to load this second record and bind it to the same view. What is the best way to do that? I tried:

Code:



viewModel: {
links: {
primaryRecord: {
reference: 'MyModel',
id: someId
},
secondaryRecord: {
reference: 'MyModel',
id: '{primaryRecord.secondaryRecordId}'
}

}
}

The documentation says that value of each property in the links config can be a bind descriptor. The above does not work for me. What am I missing?


Aucun commentaire:

Enregistrer un commentaire