I'm trying to find out how i can pass an Mvc 3 model (with pre-populated collections) to a Knockout ViewModel?
Any ideas?
Thanks in advance for your help.
Jules
You can just populate it from your Razor view by writing all the mvc model values into related js objects. But I would rather load it via Ajax call after the page is loaded. Have a look at an idea here: Lazy loading an observable in KnockoutJS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With