I have a solution of my question, but I don't know whether it exists a better solution.
Following I had implemented:
View:
<md-list>
<md-list-item>
<span ng-repeat="item in ::items track by $index" flex="auto">
{{::item}}
</span>
<md-divider></md-divider>
</md-list-item>
</md-list>
Controller:
CrudSvc.GetAll().$promise.then(
function (res) {
$scope.items = GetKeyForTitle(res);
},
function (err) {
//err code...
}
);
function GetKeyForTitle(data) {
var arrItems = [];
var resData = data[0];
angular.forEach(resData, function (val, key) {
arrItems.push(key);
});
return arrItems;
}
JSON data is simple defined:
[
{
"NAME": "John Doe",
"AGE": 25,
"CITY": "New York",
"COUNTRY": "USA"
},...
]
For my solution I used data[0]
to give me only the first data otherwise I get always the same keys and I need the keys just one time.