Sortable: throwing exception if including via bower, but not using knockout

Created on 14 Oct 2015  路  5Comments  路  Source: SortableJS/Sortable

I am using bower to include the library (using version 1.3.0, since 1.40 is currently broken).

When I loading my app, I get the following console error:

Uncaught TypeError: Cannot read property 'bindingHandlers' of undefined(anonymous function) 
@ knockout-sortable.js:155(anonymous function) 
@ knockout-sortable.js:12(anonymous function) 
@ knockout-sortable.js:14

Looking at the code, it is easy to tell that 'ko' is undefined. Is there a way to omit the inclusion of knockout-sortable.js if I am not using knockout?

Most helpful comment

Same issue with me. The best way is doing an override in your bower.json

"overrides": {
    "Sortable": {
      "main": [
        "Sortable.js",
        "ng-sortable.js"
      ]
    }
  }

All 5 comments

Same issue with me. The best way is doing an override in your bower.json

"overrides": {
    "Sortable": {
      "main": [
        "Sortable.js",
        "ng-sortable.js"
      ]
    }
  }

This issue also seems to cause issues loading other modules in Angular for some reason. I tried to use this together with textAngular and would get module loading error despite the files being there. alexshive's fix sorted this out for me.

IMO there should not be any dependencies other than the two files. If there is integration to other components then those you could use the overrides to load them.

+1

+1

Was this page helpful?
0 / 5 - 0 ratings