Answer the question
In order to leave comments, you need to log in
Why is Angular sortable-ui not working??
Hello everyone, this is the question. I wanted drag&drop sorting. I am writing using AngularJS, and in order for sorting to immediately change the model, I decided to use the sortable-ui module. I downloaded the required js, included jQuery, jQuery-UI and sortable.js:
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="{% static 'js/lib/jquery-ui-1.10.4.custom.js' %}"></script>
<script src="{% static 'js/lib/angular.min.js' %}"></script>
<script src="{% static 'js/lib/sortable.js' %}"></script>
angular.module('LookstatApp', ['ngCookies', 'ngRoute', 'ui.sortable'])
<div class="row">
<ul class="select-multiple blue-border" ui-sortable ng-model="admins">
<li ng-repeat="a in admins">{$ a.name $}</li>
</ul>
</div>
$scope.admins = [
{id: 1, name: "Админ 1"},
{id: 2, name: "Админ 2"},
{id: 3, name: "Админ 3"},
{id: 4, name: "Админ 4"},
{id: 5, name: "Админ 5"},
];
TypeError: undefined is not a function
at link (http://127.0.0.1:8000/static/js/lib/sortable.js:257:19)
at K (http://127.0.0.1:8000/static/js/lib/angular.min.js:54:390)
at f (http://127.0.0.1:8000/static/js/lib/angular.min.js:47:261)
at f (http://127.0.0.1:8000/static/js/lib/angular.min.js:47:278)
at f (http://127.0.0.1:8000/static/js/lib/angular.min.js:47:278)
at f (http://127.0.0.1:8000/static/js/lib/angular.min.js:47:278)
at http://127.0.0.1:8000/static/js/lib/angular.min.js:46:377
at link (http://127.0.0.1:8000/static/js/lib/angular-route.min.js:7:388)
at K (http://127.0.0.1:8000/static/js/lib/angular.min.js:54:390)
at f (http://127.0.0.1:8000/static/js/lib/angular.min.js:47:261) <ul class="select-multiple blue-border ng-pristine ng-valid" ui-sortable="" ng-model="admins"> angular.min.js:92
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question