Lundalogik/LimeBootstrap — pull request #30 by FredrikL (2014-02-19 10:08:05+00:00)
Title: Support for loading resources async, requires wiring in viewmodel before use

Support for async invoking of a datasource for use with [Lime.Proxy](https://github.com/FredrikL/Lime.Proxy) or other CORS aware service. Currently only a POST http request will be made.

Datasource defenition:
```Javascript
{ type:'AsyncPost', alias: "table",
url: "http://localhost:8000/v1/some_db/table/some_Table",
parameters: { Fields: ["name"], Conditions: [] }}
```
Alias and url **MUST** be supplied.

This will create 2 properties on viewModel that are [jQuery promises](https://api.jquery.com/promise/), to use data add a done handler.
Example:
```Javascript
this.initialize = function (node,viewModel) {
viewModel.coworker = ko.observable("");

viewModel.table.done(function(data) {
var d = JSON.parse(data);
viewModel.coworker(d["some_Table"]["@name"]);
});

return viewModel;
}
```

property used on vm needs to be declared before done function has run, for fast queries the result may be available before initialize is called.