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

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

The Discussion

  • User profile image

    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)?

  • User profile image

    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.

  • User profile image

    @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).

  • User profile image
    Rhys 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:

  • User profile image

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

  • User profile image

    @zico: it is Toastr,  a library I wrote. Also a NuGet package available.

  • User profile image

    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?

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.