如下,我想把item对象的属性转移到quotation...
$scope.quotation = {};
$scope.save = function(item) {
for ( var key in item) {
console.log($scope.quotation);
}
}
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
直接使用
angular.copy(source, [destination]);
对比你的例子就是angular.copy(item, $scope. quotation);
可以看这里。angular.extend
或
angular.copy