1

i have problem requirejs with ui-sortable . when i use ui-sortable without requirejs it is work for me but use requirejs it is not work and not show error for me . bellow is my code :
page=>config.js

shim:{
    'angular': {
        deps: ["jquery","jquery-ui"]
    },
    'app': {
        deps: ['angular','ui-sortable','uploadModule']
    },
    'jquery-ui': {
        deps: ["jquery"]
    },
    'ui-sortable':{
        deps: ['jquery-ui','angular']
    },
    'uploadModule':{
        deps: ['angular','ui-sortable','SplitFilter']
    }

}

require(['app'], function(){
    angular.bootstrap(document , ['app']);
});

page=>app.js

define(function () {

   angular.module('app' ,  ["coreModule","ui.sortable","uploadModule"]);

});

page=>uploadModule.js

define(function() {

var UploadMedia = angular.module('uploadModule',['ui.sortable']);
UploadMedia.controller('UploadMedia',function ($scope,$http) {

        $scope.items = ["super", "génial", "trop top", "inouïe"];
});

page=>layout

 <div class="panel panel-danger text-center mediabox" data-ng-controller="UploadMedia" >
                <div class="panel-heading"> Media </div>
                <div class="panel-body"  >

                    <ul ui-sortable="{axis:'y'}" ng-model="items">
                        <li ng-repeat="item in items track by $index">@{{item}} </li>
                    </ul>


                </div>
            </div>   
2
  • Please edit the post by including the error. Commented Sep 2, 2017 at 0:20
  • no error to show but ui-sortable no effect Commented Sep 2, 2017 at 4:48

0

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.