Jump to content
Search Community

Draggable on Aurelia

caperaven test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I am using Aurelia for a project and managed to get greensock working using the JSPM installation already available.

As part of that installation you also get draggable in the utils folder. 

I would love to use Draggable in the project but having difficulties loading getting it to load.

I realize that greensock is not ES6 compatible yet and that it may be in the future but I would love some advice on how I can possibly use Draggable in the aurelia project.

 

ps. I am using typescript.

 

One of the ways I tried to do it was just to copy the Draggable.js file into the source directory and include it as 

import './Draggable';

All my efforts to thus far gives me the runtime error that  is not found.

 

TweenMax works fine using

import 'greensock';

Just wish I could not include draggable.

 

Any suggestions?

Link to comment
Share on other sites

In your System config map you should have this...

"greensock": "github:greensock/GreenSock-JS@1.18.2",

Now add this...

"github:greensock/GreenSock-JS@1.18.2": {
  "TweenLite": "./TweenLite",
},

You should now be able to use it with this import.

import "greensock";
import "greensock/utils/draggable";

There are no TypeScript definitions for Draggable. Check out this post for more information.

http://greensock.com/forums/topic/8571-right-source-for-typescript-definitions-files/?p=55900

 

Here's an set of definitions for Draggable that I've been working on. Let me know if you run into problems with them.

https://gist.github.com/OSUblake/d8a098279d7e251eef6d

  • Like 4
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...