Skip to content

Instantly share code, notes, and snippets.

@flanger001
Last active October 12, 2016 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flanger001/0217222d48ccb10b0e795d8ef875bdc0 to your computer and use it in GitHub Desktop.
Save flanger001/0217222d48ccb10b0e795d8ef875bdc0 to your computer and use it in GitHub Desktop.
Ionic 1.3 and Typescript

How to get Ionic 1.3 working with Typescript 2.0

This is a huge pain in the butt process. Work in progress.

Starting from a new Ionic app

  • ionic start myapp tabs
  • cd myapp
  • npm install --save-dev gulp-typescript browserify tsify typings typescript vinyl-buffer vinyl-source-stream (I'm not using all of these yet)
  • Edit gulpfile:
    var typescript = require('gulp-typescript');
    var paths = {
      pages: ['src/*.html'],
      sass: ['./scss/**/*.scss'],
      src: ['./src/*.ts']
    };
    gulp.task('js', function () {
      gulp.src(paths.src)
      .pipe(typescript())
      .pipe(gulp.dest("www/js"));
    });
    
  • typings init
  • typings install dt~ionic dt~cordova dt~cordova-ionic dt~cordova/plugins/statusbar dt~angular dt~jquery --save --global

At this point everything appeared to work. If you add a watch task for paths.src and have it fire js, you should be good to go.

Starting from an existing Ionic app

  • TODO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment