I'm just wondering what is the best practice to view model data from server in Angular app?
For example in my controller i'm getting model from server (with custom ngResource service) and then I need to create somekind different model in my app's clientside:
customApiService.query({ url: 'items' }, function (res) {
// made it like this and do everything in partials with "ng-repeat"?!
$scope.items = res;
// but i need to model server data on client...
angular.forEach(res, function (key, i) {
$scope.viewModel = {
description: key.anotherNameField // e.g. different third-party services return description under different names
};
});
});