Hi,
I am facing the issue for binding data in to cshtml file with angularjs.
if we hard coded directly in to $scope.results as follows
$scope.results=[{
"user_id": "minebranch", "First Name": "minebranch", "Surname": "minebranch", "Client": "DEMO LABOUR PROVIDER (CLIENT)", "Branch": "DEMO LABOUR PROVIDER (CLIENT)", "Expr1": "minebranch", "pword": "minebranch",
"centre_group_name": "Crunch Corporate", "group_description": "Crunch Corporate", "group_id": 105, "centre_id": 260013, "branch_id": 24
}]
the binding process is working properly.But if I let them to bind from the DB(Checked and confirmed that the above hard coded result is getting) like the code line written in eventController,the binding will not happening.
Here is my controller and cshtml file.
eventModule.controller("eventController", function ($scope, EventsService) {
EventsService.Getclientlogin().then(function (data) {
$scope.results =[];
$scope.results.push(angular.fromJson(data));
}, function ()
{ alert('error while fetching talks from server') })
});
<html data-ng-app="eventModule">
<body<table id="tb_SearchResult" class="table table-striped table-bordered table-condensed " data-ng-controller="eventController">
<thead>
<tr>
<th>client</th>
<th>Surname</th>
</tr>
</thead>
<tbody>
<tr data-ng-repeat="result in results">
<td>
{{result.client}}
</td>
<td>
{{result.Surname}}
</td>
</tr>
</tbody>
</body>
</html>
Thank you,
soumya