Hi,
I am working in *angularjs*
<http://kosmiktechnologies.com/angularjs-training-hyderabad/> 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);
}
Thank You
Honey Asin
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" 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 https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.