4

I am including all necessary scripts (The error was in order of the scripts + missing jQuery):

<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 code snippet:

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

Anybody ever experienced the same and knows the way out?

1 Answer 1

11

You are missing jquery-ui library. angular-ui make use of jquery-ui library to provide sortable functionality.

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

Also jquery-ui needs jquery library, so if you have not included it, download an include it also.

Sign up to request clarification or add additional context in comments.

10 Comments

Really? I thought they said that no other dependencies are needed :(
HA! Optional Include jQuery if using jQuery Plugins and Optional Include any jQuery(UI) plugins you wish to use (plugins are not bundled with AngularUI)
@Michal no, angular-ui provides the required directive support, but the actual implementation is provided by jquery-ui
Included these and no change:( <script src="components/jquery-ui-1.10.2/jquery-1.9.1.js"></script> <script src="components/jquery-ui-1.10.2/ui/jquery-ui.js"></script>
these should be included before scripts/vendor/angular/angular.js
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.