Reputation: 187
I need to get key from the key value object inside array.
$scope.rolehiddenfields = [{"aboutyou": "aboutyou", "height": "height"}];
But want as $scope.allrolehiddenfields = ["aboutyou", "height"];
Upvotes: 3
Views: 3690
Reputation: 587
This should work:
Object.keys({ "aboutyou": "aboutyou", "height": "height" })
Upvotes: 3
Reputation: 5957
Object.keys($scope.rolehiddenfields[0]);
That should do the trick for you.
Upvotes: 4