In this example of angular.foreach, it will push both key and value i.e property name and its value in 'tempArr'. See the code snippet:
angular.foreach