1//$scope.customers is a list of customers
2// o is a response of PUT request which will be return customer updated object
3var x = $scope.customers.find(x => x._id === o.data.customer._id)
4var index = $scope.customers.indexOf(x)
5$scope.customers[index] = o.data.customer