Angular-UI Sortable Demo

by Andres Arrieche

HTML

<div ng-controller="controller">
    <ul ui-sortable ng-model="list">
        <li ng-repeat="item in list" class="item">{{item}}</li>
    </ul>
    <hr />
    <div ng-repeat="item in list">{{item}}</div>
</div>


<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.10/angular.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui/0.4.0/angular-ui.min.js"></script>

<!--
The problems is that when I try to change a element from top to down ONE possition is does NOTwork, for example take "one" and take it one position down to get "two,"one","three","four", ... second list should change too but it doesn't

-->

JavaScript

var myapp = angular.module('myapp', ['ui']);

myapp.controller('controller', function ($scope) {
    $scope.list = ["one", "two", "three", "four", "five", "six"];
});

angular.bootstrap(document, ['myapp']);