Ionic2- how to execute ng commands inside an ionic2 project

Here is the thing, I’m developing an ionic2 mobile app using Angular2 and typescript.
I’m able to perform ionic2 commands from command line. I’ll list a few I am able to peform:

1)ionic generate page pagename
2) ionic serve

since it based on angular2, I thought I can execute angular2 commands as well. I wanna create a class. So I gave the following command

ng g cl classname

but it wasn’t executed. Following message was shown:


You have to be inside an angular-cli project in order to use the generate command

So I’m doing it manually. Is there a way I can generate it using command line, so that way dependencies will get added in app.module.ts file as well.

Angular CLI is already installed. NodeJS and all necessary things for angular2 project has already been installed in my machine. I can use these commands in an a pure angular2 project but not in ionic2 project which is build using angualar2

Why is it so?

I’m trying to achieve the same thing (using Angular CLI inside an Ionic 2 app) - can anybody help?