<!DOCTYPE html> <html lang="en" ng-app="myModule"> <head> <meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1"/> <link rel="stylesheet" type="text/css" href="css/bootstrap.css" /> </head> <body ng-controller="myController"> <nav class="navbar navbar-default"> <div class="containet-fluid"> </div> </nav> <div class="col-md-6 well"> <hr style="border-top:1px dotted #ccc;"/> <div class="col-md-6"> <table class="table table-bordered"> <thead class="alert-info"> <tr> </tr> </thead> <tbody> <tr ng-repeat="member in members"> </tr> </tbody> </table> </div> <div class="col-md-6"> <table class="table table-bordered"> <thead class="alert-info"> <tr> </tr> </thead> <tbody> <tr ng-repeat="member in members2"> </tr> </tbody> </table> </div> </div> </body> </html>
var app = angular.module("myModule", []) .controller("myController", function($scope){ $scope.members = [ {name: "John Smith", address: "New York"}, {name: "Claire Temple", address: "Racoon City"}, {name: "Jack Froze", address: "Iceland"}, {name: "George Flame", address: "Fireland"} ]; $scope.members2 = []; $scope.moveMember = function(member){ $scope.members2.push(member); $scope.members.splice($scope.members.indexOf(member), 1); }; });