angular.js - How to transfer the properties of one object to another object in angularjs? ?
我想大声告诉你
我想大声告诉你 2017-05-15 17:02:31
0
2
1547

As follows, I want to transfer the attributes of the item object to quotation...

$scope.quotation = {};
                            
        $scope.save = function(item) {
                                
    for ( var key in item) {
                                    
    
        console.log($scope.quotation);
                            }
                            
                            }
                            
我想大声告诉你
我想大声告诉你

reply all(2)
黄舟

For direct useangular.copy(source, [destination]);对比你的例子就是angular.copy(item, $scope. quotation); you can see here.

给我你的怀抱

angular.extend
or
angular.copy

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template