[SOLVED][Help] Upgrading JS project to TS


#1

Hi guys,

Tried upgrading my JS sources to TS but the compiler is still looking for the app.js file.

Any guide I could use on how to upgrade your Ionic 2 project with JS to TS?

Thanks in advance.


#2

Look for the line in gulpfile.js that looks somewhat similar to but not quite like this, and make it look like this:

var buildBrowserify = require('ionic-gulp-browserify-typescript');

#3

better start a new project with --ts
ionic start MyIonicApp --v2 --ts

and copy-paste your code into the files of the same name in ts project.
For changing your code according to .ts from .js consider this amazing tutorial. :slight_smile:


#4

I’m encountering plenty of ‘Property does not exist’

Anyway around this?


#5

Declaring all the properties on your classes.


#6

Fixed it by changing "ionic-gulp-browserify-typescript": "^1.1.0", in the package.json file to "ionic-gulp-browserify-typescript": "1.1.0",

From there I declared the variables.

Thanks everyone for the help :slight_smile: