Generate Page into ts file


#1

We know that ionic 2 has a feature to generate page into our application using command “ionic generate page x”.

The problem is page that was generated is javascript file. How do I generate page that is typescript file ? Thanks.


#2

Unfortunately this is not supported at the moment:


#3

Are you sure? ionic generate page ‘name’ --ts worked quite fine for me.


#4

I don’t know, then it might be fixed in the meantime - the last time I’ve tried it I got JS files instead of TS files. Strange that there’re also no updates in the issue though. @DarthRevan Which version of the Ionic-CLI are you using?


#5

So far as I know, it was integrated in latest beta. Here the CLI I’m using:

Ionic Framework Version: 2.0.0-beta.4
Ionic CLI Version: 2.0.0-beta.24


#6

Mine is not updated yet to the latest version. So, I’ll try it later. Thank you guys :smiley:


#7

Thanks for the info, I just updated to the latest beta and I can confirm that it’s generating TS-files in a TS-project (even without adding --ts explicitly).


#8

I’m sorry, but what command do I use to update my ionic version ?


#9

Here is a good explanation (you can check out the linked post for more details):