AndreyAkinshin / knockout-mvc

Power of Knockout.js for ASP.NET MVC
http://knockoutmvc.com
203 stars 125 forks source link

KnockoutContext extended for working with multiple ViewModels in a same MVC View #38

Closed vfportero closed 10 years ago

vfportero commented 11 years ago

I've create a new constructor for CreateKnockoutContext extension to accept a string as a custon ViewModelName (needed to use multiple viewmodels in a same view like a partials...).

Also, the Apply method have been extended to accept two new parameters:

wrapperId -> The elementid to do the knockout binding (needed for multiple viewmodels in same mvc view). Empty by default for back compatibility. applyOnDocumentReady -> adds the "$(document).ready" header to the autogenerated binding script. False by default for back compatibility. All is tested and working in my development environment.

Regards!

PS: Merged with current brunch and edited for follow the Code Guidelines

vfportero commented 11 years ago

Added demo page

AndreyAkinshin commented 10 years ago

Thanks!