You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Angular and AngularJS discussion
Hi,
I am working in angularjs and I am making a call to WCF, which is further making a call to 'Business Layer' which is returning 'DataTable' data to WCF service. Now WCF needs to return the DataTable to Client side(.html page), so I am currently converting the DataTable to JSON string format and returning it to UI. At UI side, while making a Javascript object from the JSON string using angular.fromJson() function the sequence of column names gets changed and Javascript arrays are being made in alphabetical order. I do not want data to be alphabetically sorted when Javascript object is made.
So my query is as below: 1) How to prevent angular.fromJson() function from sorting data in JSON string in alphabetical order when it prepared JS Array from JSON string?
2) Is converting DataTable data to JSON string a good approach?; or I should use some other data format.
This is the code snippet I am using: { var dimensionID = dimensionId; var dataobj = JSON.stringify({ "dimensionId": 196 }); var response = commonservice.post(dataobj, 'ViewDimensionDetails');/ ShowLoader(); response.then(function (result) { // result.data is JSON string returned by WCF $scope.data = angular.fromJson(result.data); }