angular.js - angularjs如何把一个对象的属性 转移到另一个对象中??
我想大声告诉你
我想大声告诉你 2017-05-15 17:02:31
0
2
1514

如下,我想把item对象的属性转移到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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!