发布时间:2014/11/06 来源:长沙做网站

JavaScript Code:
|
1
2
3
4
5
6
7
8
|
angular.module('daybabyApp') .controller('MainCtrl', function ($scope) { $scope.todos = [ 'one', 'two', 'three' ];}); |
HTML Code:
|
1
2
3
4
5
6
7
8
|
<div class="row" ui-sortable ng-model="todos"> <div class="input-group" ng-repeat="todo in todos" style="padding:5px 10px; cursor:move;"> <input type="text" ng-model="todo" class="form-control"> <span class="input-group-btn"> <button class="btn btn-danger" ng-click="removeTodo($index)" aria-label="Remove">X</button> </span> </div></div> |

