This is a migrated thread and some comments may be shown as answers.

How to provide a schema using angular and $resource

1 Answer 130 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Ries
Top achievements
Rank 1
Ries asked on 05 Dec 2014, 09:43 PM

I have a rest service create like this:

  .factory('restService', ['$resource', function ($resource) {
    return $resource(contexturl + '/rest/:url', {}, {
      foo_service: {method: 'GET', params: {url: 'foo_service'}, isArray: true},
...
...

I call that something like this:
restService.foo_service({......}, function (data) {
        fooServiceData = data;
.... do other work
      }, function (errorObj) {
// handle error
      }).$promise;


That I can apply use with a angular grid like this:

<div id="maingrid" kendo-grid="maingrid" style="height: 200px" options="myOptions" k-data-source="fooServiceData"></div>

How do I supply a schema like I see in the examples?
Ultimately my goal is to ensure that data-uid is my primary key of my object rather then some UUID.

Or, how can I connect a angular resource to a kendo data source?

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 09 Dec 2014, 01:44 PM
Hello Ries,

You can specify schema configuration as part of the dataSource configuration. Please check the following example and let me know if it helps.

http://dojo.telerik.com/OLUse

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Data Source
Asked by
Ries
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or