Angular - method not sorting

I include all the necessary scripts (the error was in the order of the scripts + jQuery is missing) :

<script src="scripts/vendor/angular/angular.js"></script> <script src="components/angular-bootstrap/ui-bootstrap-tpls.js"></script> <script src="components/angular-ui/build/angular-ui.js"></script> 

And using this piece of code:

 <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> 

But I keep getting this error:

 TypeError: Object [object Object] has no method 'sortable' 

Has anyone ever experienced the same thing and knew a way out?

+4
source share
1 answer

You are missing the jquery-ui library. angular -ui use the jquery-ui library to enable sorting.

The angular -ui library depends on the jquery-ui library, so download and add jquery-ui.css and jquery-ui.js to the project.

Also jquery-ui needs a jquery library , so if you have not enabled it, download also enable it.

+11
source

All Articles