How do I use KnockoutJS to bind a dictionary collection to a select list.
If my “Destinations” dictionary looks like this in JSON:
{"Europe":"Europe incl Egypt, Turkey & Tunisia","ANZO":"Australia & New Zealand","WorldwideUSA":"Worldwide (incl USA & Canada)"}
How do I bind this to a select list. Something like this:
data_bind="value: Destination, options: Destinations.Value, optionsText: Destinations.Key"
Typically, when dealing with a dictionary, you will want to map it to an array containing objects with key/value properties.
Would be something like:
Sample here: http://jsfiddle.net/rniemeyer/7yDTJ/