Loading user information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading user information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

KnockoutJS and MVVM: Tips for Building HTML and JavaScript Web Apps

1 hour, 4 minutes, 54 seconds


Right click “Save as…”

Slides (view online)
+My schedule - My schedule

Do you write a lot of HTML and JavaScript code to push and pull data? In this session, learn popular techniques to use data binding to bind your data to your target controls in HTML writing less code, but gaining more power. See how to consume JSON data, use JSON objects in JavaScript, use declarative binding, using KnockoutJS. Also, see how to use the MVVM pattern to write data-centric Javascript code that follows good separation patterns and creates highly maintainable code.

Follow the discussion

  • Oops, something didn't work.

    Getting subscription
    Subscribe to this conversation
  • Have you used a T4 template or something to generate Knockout view models from webAPI objects or Entity Framework Entities?  Any other tips on automating the bindings between backend objects and JS?

    Any thoughts on SignalR within this space? 

    What's new with webAPI and oData?

    What are some quick tips on organizing large JS libraries?  How does Breeze help? Any other libraries for this (require.js for instance)?

  • I am really interested in KnockoutJS, but really would like a cleaner way to get my C# models or view models into JS. I do not like to duplicate things.

  • John Papajopapa Evangelist on the Loose

    @dirq: I don't use T4. I use breeze.js which helps take the models from the web service (JSON) and hydrate them into observable entities that Knockout uses. No duplication there.

    SignalR rocks. Works great with KO.

    web api and odata work great too, choose whatever web service tech you like.

    folder structure is important, like always. using patterns like module pattern is critical, IMO. and dependency management is also super important (require.js with durandal or just angular).

  • Rhys JonesRhys Jones

    I too was looking for a similar way to generate validating Knockout viewmodels from data-annotated c# models. I eventually came across John Culviner's FluentKnockoutHelpers which seem to do the trick: https://github.com/johnculviner/FluentKnockoutHelpers

  • Wolfgang Zieglerzico zico

    John which library are you using for the toast notifications?I could really use that.

  • John Papajopapa Evangelist on the Loose

    @zico: it is Toastr,  a library I wrote. https://github.com/CodeSeven/toastr. Also a NuGet package available.

  • MikeSMikeS

    Having to use explicit function calls or not for property gets and sets depending on whether or not you drank some observable Kool-Aid or not sucks. I am not sure why once I apply bindings using ko or kendo or whatever and they transform everything in the viewmodel to an observable why I have to realize that happened and code accordingly. Can't they just intercept the gets and sets without me knowing and do the right thing?

Remove this comment

Remove this thread


Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.