angular.foreach
works very similar to for loop and this loop contains all properties of object in key-value pairs of object. In this example, We have 'values' as an array object and angular.forEach
iterate on each property of obj and push will add the name property in 'names' array and display name in UI. See the code snippet: