How can I do the following validation using knockout js? I have the following view model:
function ViewModel () {
var self = this;
self.ListName = ko.observable();
self.Current = ko.observable();
self.MyVideos = ko.observableArray();
}
Where MyVideos have the following structure:
[{
"VideoID": 1,
"VideoName": "First Video"
},
{
"VideoID": 2,
"VideoName": "First Video"
}]
So Current and VideoId are the relation, and I want to render the VideoName with the self.Current value.
It sounds like
Currentis theVideoIdand you want to display theVideoName. For that scenario you could do: