我是一个使用AngularJS编写应用程序的开发者,想知道如何将一个数组中的元素推入到另一个数组中。
下面是示例代码:
我该如何将值为“Do the dishes”的项目推送到tasksDone数组中?
下面是示例代码:
$scope.tasks = [
{title: "Do the dishes"},
{title: "Walk the dog"},
];
$scope.addToTasksDone = function() {// IM FAILNG HERE};
$scope.tasksDone = [];
我该如何将值为“Do the dishes”的项目推送到tasksDone数组中?