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

non-callback for count

1 Answer 38 Views
JavaScript SDK
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
jon
Top achievements
Rank 1
jon asked on 03 Sep 2014, 10:11 AM
hi, please tell me how to get the count value without using callback as follows:

var el = new Everlive('your-api-key-here');
var data = el.data('Books');
data.count()
.then(function(data){
alert(JSON.stringify(data));
},
function(error){
alert(JSON.stringify(error));
});


1 Answer, 1 is accepted

Sort by
0
Anton Dobrev
Telerik team
answered on 04 Sep 2014, 11:20 AM
Hi Jon,

Most of the methods in the Backend Services JavaScript SDK are asynchronous. In this case the method returns a promise which is resolved when the asynchronous task is completed.

Also, you can use PowerFields for retrieving counts if this will fit better your scenario.

Please, let me know if you have further questions.

Regards,
Anton Dobrev
Telerik
 
Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
 
Tags
JavaScript SDK
Asked by
jon
Top achievements
Rank 1
Answers by
Anton Dobrev
Telerik team
Share this question
or