How to create angular 2 component into Nativescript Application?

A more accurate answer for 2019 (from a file called adding-Angular-CLI-to-NativeScript.md in the @nativescript/schematics package):

Adding Angular CLI to a NativeScript project.

  1. Add angular.json to the project root, with the following content
{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "cli": {
    "defaultCollection": "@nativescript/schematics"
  },
  "projects": {
    "my-project-name": {
      "root": "",
      "sourceRoot": ".",
       "projectType": "application",
       "prefix": "app"
    }
  },
  "defaultProject": "my-project-name"
}

You can update my-project-name to the actual name of your project, but that is not absolutely necessary.

  1. Install Angular CLI
npm i --save-dev @angular/cli
  1. Install NativeScript Schematics
npm i --save-dev @nativescript/schematics

You can now use Angular CLI commands in your NativeScript project:

ng generate component hello-world

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