I m trying to integrate Kendo-ui into my AngularJS app. I have a working AngularJS app with ngResource as following:
(function () {
"use strict";
angular
.module("app")
.controller("RoleListCtrl",
["roleResource",
RoleListCtrl]);
function RoleListCtrl(roleResource) {
var vm = this;
roleResource.query(function (data) {
vm.roles = data;
});
}
}());
I want to use the same roleResource.query() to get data for a <kendo-treelist options="treelistOptions"></kendo-treelist>. I tried as following:
$scope.treelistOptions = {
dataSource: {
type: "odata",
transport: {
read: function (e) {
roleResource.query(function (data) {
return data;
});
}
},
schema: {
model: {
id: "id",
expanded: true
}
}
}, ......
It can start to loading data but the data never loaded (the loading.gif running for ever).
What is the right way to use Angualr-Resource with kendo dataSource?
Thanks,