This example is hard to follow because it skips over key details, like what 
is serializing the data, is that C#?  But it doesn't matter what the back 
end is... I have to assume that getProductDetails on your service makes a 
call to the webserver which is returning json, but how is it being called 
in your service $http or $resource?  

If you are receiving a json string from an ajax call correctly, it should 
automatically be eval'd into a Javascript object such that 
console.log(items) should show you an array of objects and not a serialized 
json string.  What are you seeing as the response in the network tab of 
browser's developer tools?

Angular's ng-repeat expects an array (or object) to iterate over so sounds 
like you need to be sure what data you are getting from the server and what 
"type" of data it is at the time of being bound to the $scope for ng-repeat.





On Friday, February 21, 2014 9:29:41 AM UTC-7, Zaki Noori wrote:
>
> I am new to angular so bare with me please.
>
> I am using dynamic objects to create properties and want to send this to 
> angular to display in table rows.
>
> here is my code to create dynamic objects and serialize to Json(it is cut 
> down version):
>
> List lstDynamic = new List();
>
> foreach (var Prods in ProdList){dynamic dobject = new 
> System.Dynamic.ExpandoObject();  SetDynamicProperty(displayAttribute, 
> dobject);var json = JsonConvert.SerializeObject(dobject);
> lstDynamic.Add(json);}
>
> my data at end looks like this :
>
> [image: enter image description here]
>
> and in angular
>
> productDetailsApp.controller('productDetailsCtrl', function ($scope, 
> productDetailsService) {
>     $scope.stransferAmount = 2000;
>     $scope.sAPR = 17.9;
>     var items = [];
>     productDetailsService.getProductDetails().then(function (prodDetails) {
>         items = prodDetails;
>         $scope.productDetails = items;
>         //console.log(items);
>     }),
>         function () {
>             //error
>         };});
>
> And in html :
>
>    <tbody>
>       <tr data-ng-repeat="attNameValue in productDetails">
>         <td>
>          {{attNameValue.APR}}
>         </td>
>       </tr>
>    </tbody>
>
> But still nothing gets displayed, I can see two table rows but no data, I 
> can see my objects in chrome browser console too. Am I missing something?
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to