Is Class available in Ionic Generator? I get strange result


I am familiar with Angular CLI which provides ‘Class’ generator. So we can create a typescript file with simple class declaration with following command:

ng g class Foo

In CLI help, Ionic shows only following items it can generate:

ionic generate - Generate pipes, components, pages, directives, providers, and tabs (ionic-angular >= 3.0.0)

But I tried to use same command with Angular CLI:

ionic g class Foo

and got result:

[OK] Generated a class named FireBaseEnvironment!

First, I glad it looks work well in Ionic project here. But after finding for that fresh-generated class file, it looks like there isn’t real file generated.

Does Ionic generator really support ‘Class’? if yes, where would it be placed in project? or I am misunderstand something?


Why do you want to generate a Class?

It isn’t offered by ionic generate, so if it does something on calling that command this looks more like a bug to me.


PS C:\Users\Jan\Documents\superTest> ionic g telephone foo
[OK] Generated a telephone named foo!

Yeah, seems like a CLI bug :wink:


I create an issue for it:


@Sujan12 Thank for make it clearly it’s bug! :smiley:

Anyway, I think it would more handy if Ionic’s generator can generate ‘Class’ like Angular CLI do. In some case, a solid class is useful.


You know the link to the repo now :wink: