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);
}
}
For direct use
angular.copy(source, [destination]);
对比你的例子就是angular.copy(item, $scope. quotation);
you can see here.angular.extend
or
angular.copy