The data is being retrieved but is not updating the bind variables on the page below is the url to VF page that i am using .
https://vffiddle.herokuapp.com/945#
Please advise .
Thanks, Sandeep
Added from the link
<apex:page showHeader="true" sidebar="true">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.13/angular.min.js"></script>
<apex:remoteObjects jsNamespace="test" >
<apex:remoteObjectModel name="Test__c" jsShorthand="TB" fields="Name,Id">
<apex:remoteObjectField name="Email__c" jsShorthand="email"/>
</apex:remoteObjectModel>
</apex:remoteObjects>
<div ng-app="app" ng-controller="MyCtrl" >
<input id="textid" type="text" placeholder="Search Text" ng-model="SearchText" />
<button ng-click="searchRec();">Search</button>
<table >
<tr >
<th>
<span >emails</span>
</th>
</tr>
<tr ng-repeat="x in emails">
<td data-label="activity" >
<span > {{ x.email}}</span>
</td>
</tr>
</table>
</div>
<script>
var app = angular.module('app', []);
var lst=[];
app.controller('MyCtrl', function($scope) {
var en = new test.TB();
$scope.searchRec = function(){
alert('insidecalculateService');
console.log($scope.SearchText);
en.retrieve({where:{email:{like:"%"+$scope.SearchText+"%"}},limit: 30 }, function(err, records, event){
if(err) {
alert(err.message);
}
else {
console.log('test:'+records[0].get("email"));
alert('test:'+records[0].get("email"));
records.forEach(function(record) {
lst.push({email:record.get("email")});
});
}
$scope.calculateService();
});
};
$scope.calculateService = function(){
console.log('insidecalculateService',lst);
alert('insidecalculateService'+lst);
$scope.emails=lst;
$scope.SearchText='';
//lst=[];
};
});
</script>
</apex:page>