Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ES6 Modules? #35

Open
reid-rigo opened this issue Nov 6, 2015 · 1 comment
Open

ES6 Modules? #35

reid-rigo opened this issue Nov 6, 2015 · 1 comment

Comments

@reid-rigo
Copy link

This gem doesn't appear to allow ES6 import/export syntax. Is there a way to do this with the asset pipeline?

@jll90
Copy link

jll90 commented Apr 13, 2016

I'm using the typescript-rails gem and Rails 4.

Here's what I did to export a module.

//myMod.ts
module myMod {

  export myFunction (){

  }

  export myClass (){

  }
}

Then, in another file you can import using the following:
/// <reference path="./myMod.ts" />

You can call
myMod.myFunction();
inside any other file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants