javascript - How an angular object gets the value of another object -


How can I get all the properties from the object?

This code is:

  this.makeReady = function (order) {var tempOrder = angular.copy (command); TempOrder.status = 1; Angular.forEach (tempOrder.items, function (item) {item.status = 1;}) $ http.put ('/ rest / change / invoice /' + order.id + '/', tempOrder). Return (function) () {order = tempOrder; // this does not work}}; }   

In case of success: Change the value of that object.

Try editing the order directly in your $ scope.allOrders and See if you get the behavior you are looking for.

  this.makeReady = function (order) {var tempOrder = angular.copy (order); Var order index = $ scope.all orderers. Indexoff (order); TempOrder.status = 1; Angular ForEach (tempOrder.items, function (item) {item.status = 1;}); Return $ http.put ('/ rest / change / invoice /' + order.id + '/', tempOrder) .success (function () {$ scope.all orderers [orderIndex] = tempOrder;}); }    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -