How to create angular 2 component into Nativescript Application?

3logy picture 3logy · Jan 1, 2017 · Viewed 8.9k times · Source

I'm using nativescript with angular 2.

I'm wondering how to rapidly create a ng component in a Nativescript Project. For example into Angular 2 to create a component we are using ng generate component hello.

Is there a nativescript cli solution for that?

Answer

Mariano Agüero picture Mariano Agüero · Nov 30, 2017

You can use https://github.com/sebawita/nativescript-angular-cli

To generate a component, run:

tns generate component <component-name>
tns g c <component-name>

To create a component inside a module, run:

tns generate component <component-name> <module-name>
tns g c <component-name> <module-name>

Cheers