I am using below code in my angular using lbservices, I want to get value of count, but I instead of output as a1=8 and a2=8, I am getting result as a1=8 and a2=2,
var getOrganisationCount = function () {
var count = 2;
var query = {};
Organisation
.count()
.$promise
.then(function (response) {
count = response.count;
console.log('a1===' + count);
});
console.log('a2=' + count);
};
getOrganisationCount();