Skip to content

ES6 Modules? #35

Open
Open
@reid-rigo

Description

@reid-rigo

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

Activity

jll90

jll90 commented on Apr 13, 2016

@jll90

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @reid-rigo@jll90

        Issue actions

          ES6 Modules? · Issue #35 · typescript-ruby/typescript-rails