tns-ng
NativeScript 的 Angular CLI。为 Nativescript Angular 项目生成组件
npm i --save tns-ng

Tns Ng

npm version

NativeScript 的 Angular CLI。为 Nativescript Angular 项目生成组件

目录

安装

npm install -g tns-ng

用法

tng --help

生成组件和服务

tng generate|g [type] [name] 

您可以使用 tng generate(或简写为 tng g)命令来生成 Nativescript Angular 组件

tng generate component my-component
tng g component my-component # using the alias

# components support relative path generation
# if in the directory app/feature/ and you run
tng g component my-component
# your component will be generated in app/feature/my-component
# but if you were to run
tng g component feature/my-component
# your component will be generated in app/feature/my-component

# This will create four files:
__my-component__/__my-component__.component.html
__my-component__/__my-component__.component.ts
__my-component__/__my-component__.component.android.css
__my-component__/__my-component__.component.ios.css

以下表格列出了所有可能的类型

脚手架 用法
组件 tng g component my-component
服务 tng g service my-service

贡献

只需 Fork 并发起拉取请求 :D