@{
Layout = null;
}
<!DOCTYPE html>
<html ng-app="my_app">
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
<script src="~/Scripts/jquery-1.10.2.min.js"></script>
<script src="~/Scripts/angular.min.js"></script>
<script type="text/javascript">
var app = angular.module("my_app", []);
app.controller('my_controller', function ($scope) {
var vm = $scope.vm = {};
vm.students = [
{ id: 1, name: '张三', age: 17 },
{ id: 2, name: '李四', age: 18 },
{ id: 3, name: '王五', age: 19 },
{ id: 4, name: '马六', age: 20 }
];
vm.destination = [];
alert(angular.equals(vm.students, vm.destination));//比较,false
angular.copy(vm.students, vm.destination);//深度复制
alert(angular.equals(vm.students, vm.destination));//比较, true
});
</script>
</head>
<body ng-controller="my_controller">
</body>
</html>