Convert plugin to ng-directive


This should be straightforward, but I’m missing something.

I am using the greensock draggable animation library, grunt, bower, npm, etc.

bower.json dependencies:

enter image description here

grunt (in CoffeeScript), bower_concat main files: because the draggable component isn’t listed in the tween file in greensock’s bower.json:

enter image description here

my directive, in CoffeeScript:

enter image description here

My jasmine test is saying it can’t find the reference to Draggable.js in my compiled JS.

ReferenceError: Can’t find variable: Draggable in file:///Users/ari.picker/apps/LightHouse/lighthouse/lighthouse-ui/.grunt/grunt-contrib-jasmine/temp/compiled-coffee/src/lessons/panes-directives/greensockDraggable.js (line 9)


Try changing "greensock" to "gsap"in your grunt file.

Including TweenMax with the plugins/utils seems to work.

mainFiles: {
  "greensock": ["src/uncompressed/TweenMax.js", "src/uncompressed/utils/Draggable.js"]

Answered By – Blake Bowen

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published