0

I'm developing an ASP Web API project and using KnockoutJS as the client side technology. To the best of my knowledge there are no examples projects or any kind of sources available in internet for these two technologies yet. If someone has used these two technologies for their development, it is great if you can provide some links here (If there are online sources). I am posing this not as a question but to get some online sources about these technologies to one place (Because as I know there are no online sources yet). If someone know any sources about the projects which have used these two technologies in there architecture, it will be a great help for me (Since there are no online sources).

Thank you.

Thilok Gunawardena
  • 924
  • 5
  • 22
  • 44

3 Answers3

2

You should checkout upshot.js, Steve Sanderson's library for interfacing with WebAPI REST services. It is designed to complement knockout.js when building single page applications, facilitating communication between the view model (knockout) and the back end (WebAPI).

Here's a relevant SO post: Where can I find Upshot.js examples and documentation?

Community
  • 1
  • 1
bmode
  • 760
  • 6
  • 9
1

I don't really have any links to share, but on the server side WebAPI outputs JSON by default and client/KnockoutJS side you are just consuming JSON. I use jQuery's .getJson() method and update my KO view model with the return data.

Check out John Petersen's blog for some good Web API samples.

Joel Cochran
  • 7,139
  • 2
  • 30
  • 43
1

Technically, Knockout.js doesn't help with accessing a REST API specifically Knockout with JSON. So, yea it works fine and I've used to with the Web API no problem. There is the Mapping plugin that helps with mapping the data to your view models which may be useful to you: http://knockoutjs.com/documentation/plugins-mapping.html

Backbone.js is meant to work with REST APIs (like Web API) and there is a project that makes Knockout work with Backbone (https://groups.google.com/forum/?fromgroups#!topic/knockoutjs/SAESwAqjfK4). I haven't used it so I don't know if it works well or not.

BeaverProj
  • 2,205
  • 1
  • 17
  • 31