Convert plugin to ng-directive

Issue

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)

Solution

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

Answer Checked By – Katrina (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.