Edit: see Steven's blog post here with sample download code: http://blog.stevensanderson.com/2012/03/06/single-page-application-packages-and-samples/
I donβt know how to access the assistant, I would like to know that I could play with him :-)
This seems to be a trick now:
<script src="../../Scripts/knockout-2.0.0.js" type="text/javascript"></script> <script src="../../Scripts/upshot.js" type="text/javascript"></script> <script src="../../Scripts/upshot.compat.knockout.js" type="text/javascript"></script> <script type="text/javascript"> upshot.metadata({ "CLASSNAME:#NAMESPACE":{ "key": ["aId"], "fields": { "aId": { "type": "Int32:#System" }, "Title": { "type": "String:#System" }, "Description": { "type": "String:#System" }, "Effort": { "type": "Double:#System" } } } }); var myDataSource = new upshot.RemoteDataSource({ providerParameters: { url: "http://localhost:7018/api/CONTROLLERNAME", operationName: "", operationParameters: {} }, entityType: "CLASSNAME:#NAMESPACE" }); myDataSource.refresh(function (results) { alert(results[0].Title()); }); </script>
You need to replace CLASSNAME: #NAMESPACE with your name and namespace, for example: "WorkItem: # MySystem.Models".
And replace CONTROLLERNAME with the actual controller name, in case of this
public class MyTasksController : ApiController
you will need to replace CONTROLLERNAME MyTasks
And fill in the material inside the metadata according to your model objects. I hope the code samples appear on the web soon, because it is a lot of work: - (
Erik Lieben Feb 19 '12 at 18:03 2012-02-19 18:03
source share