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

Read data from AngularJs Service

1 Answer 135 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
DM
Top achievements
Rank 1
DM asked on 26 Jan 2017, 08:56 AM

Hi

 

I try to read data from my angular service with this code (see below) but when i try to do a read() after init my service never call, what I'm wrong? I need to do that to reduce amount of data and re read when change month on scheduler using dataBound event

transport: {
                    read: function (e) {
                        return modelService.getData({
                            startDate: vm.startDate,
                            endDate: vm.endDate,
                            userIds: []
                        }).success(function (result) {
                            e.success(result.data);
                        });
                    }
                },
                schema: {
                    type: 'json',
                    data: 'result.times'
                }

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Boyan Dimitrov
Telerik team
answered on 30 Jan 2017, 07:48 AM

Hello Mattia,

I am not able to find anything wrong with the provided code. 

We do have an example which illustrates how to bind the grid to a angular http service. Please refer to the  HTTP Service Binding the Grid example. 

Regards,
Boyan Dimitrov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Data Source
Asked by
DM
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or