Entries:
Comments:
Posts:

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

Download

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

  • 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.

Remove this comment

Remove this thread

close

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.