Child pages
  • How to use TypeScript for Web Package projects

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Install https://github.com/palantir/eclipse-typescript TypeScript plugin into Servoy Developer
  2. In Solution Explorer, under "All web package projects", right-click the project you want to have TypeScript,
    and select "Configure" then "Enable TypeScript Builder"
  3. Change the extension of all your "js" files to "ts"
  4. Make sure your "ts" files are transpiled during project build, go to "Window", "Preferences", "TypeScript", "Compiler" and
    enable "Compile all TypeScript files on build"
  5. Include in your "ts" files the type definitons for Angularjs; you can download this from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/angularjs/angular.d.tsangular typings file, and include it in you project, then add the
    following line in your "ts" file, at the top : 

    Code Block
    languagejs
    /// <reference path="../angularjs/angular.d.ts" />

    make sure you set the correct path to the type definiton file

  6. If you are using other libraries, like jquery, you can try to find an already created type definition here https://github.com/DefinitelyTyped/DefinitelyTyped that you can include just like for Angularjs in the previous step

...