PHPackages                             anton/ng2-template - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. anton/ng2-template

ActiveProject[CLI &amp; Console](/categories/cli)

anton/ng2-template
==================

CLI generator for ankor webpack angular 2 start kit

v1.0.0(9y ago)121PHP

Since Sep 26Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ancor-dev/ng2-template)[ Packagist](https://packagist.org/packages/anton/ng2-template)[ RSS](/packages/anton-ng2-template/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Angular 2 CLI Templates
=======================

[](#angular-2-cli-templates)

Creation main project elements with unit tests

Installation
------------

[](#installation)

```
ln -s $(realpath ng-templator.php) ~/bin/ngt
chmod +x ~/bin/ngt
```

Notice: `~/bin` should be added to $PATH.

Generating of blanks
--------------------

[](#generating-of-blanks)

- [Component](#component)
- [Small Component](#small-component)
- [Module](#module)
- [Directive](#directive)
- [Pipe](#pipe)
- [Service](#service)
- [Api Service](#api-service)
- [Model](#model)

---

### Component

[](#component)

```
$ ngt component my-component
```

Makes structure:

```
.
└───my-component
    ├───index.ts
    ├───my-component.component.pug
    ├───my-component.component.less
    ├───my-component.component.ts
    ├───my-component.component.spec.ts

```

Parameters:

- `-tp\--tag-prefix my` - (Note! without dash) makes prefix `my-` for component tag selector.
    Default value is `app-`
- `-s\--style less` - generate styles in `.less` format instead of `.scss`

### Small Component

[](#small-component)

```
$ ngt small-component my-component
```

Makes component with inline styles and template

Makes structure:

```
.
├───my-component.component.ts
├───my-component.component.spec.ts

```

Parameters:

- `-tp\--tag-prefix my` - (Note! without dash) makes prefix `my-` for component tag selector.
    Default value is `app-`
- `-s\--style less` - generate styles in `.less` format instead of `.scss`

### Module

[](#module)

```
$ ngt module my-module
```

Makes structure:

```
.
└───my-module
    ├───index.ts
    ├───my-routes.module.ts

```

Parameters:

- `-wc\--with-component` - additionally makes main component for the module.
    File structure:

    ```
      .
      └───my-module
          ├───index.ts
          ├───my-routes.module.ts
          ├───my-component.component.pug
          ├───my-component.component.less
          ├───my-component.component.ts
          ├───my-component.component.spec.ts

    ```

    Component parameters `-tp`, `-s` also available when you creates component with a module.

### Directive

[](#directive)

```
$ ngt directive super-highlight
```

Makes structure:

```
.
├───super-highlight.directive.ts
├───super-highlight.directive.spec.ts

```

Parameters:

- `-sp\--selector-prefix my` (value without dash) makes prefix `my` for directive selector.
    Result will be `mySuperHighlight`
    Default value is `app`

### Pipe

[](#pipe)

```
$ ngt pipe pretty
```

Makes structure:

```
.
├───pretty.pipe.ts
├───pretty.pipe.spec.ts

```

### Service

[](#service)

```
$ ngt service auth
```

Makes structure:

```
.
├───auth.service.ts
├───auth.service.spec.ts

```

### Api Service

[](#api-service)

```
$ ngt api user
```

Makes structure:

```
.
├───user-api.service.ts
├───user-api.service.spec.ts

```

### Model

[](#model)

```
$ ngt model user
```

Makes structure:

```
.
├───user.model.ts
├───user.model.spec.ts

```

Parameters:

- `-f\--fields` makes fields for the model.
    Available modifiers:

    - `s` - string (also default if not specified)
    - `b` - boolean
    - `n` - number
    - `a` - any
    - `MyClass` - custom type definition

    Every model has `id:n` field by default.
    If you don't want to use `id` just specify field `-id` in fields. Example: `-f '-id'`. Notice: Specify `-id` as first column will not works.

    Example: `name;surname;email:s;age:n;isAdmin:b;currency:Currency;createdAt:a`Result will be

    - `user.model.ts`
        Declarations: ```
        public id: number;
        public name: string;
        public surname: string;
        public email: string;
        public age: number;
        public isAdmin: boolean;
        public currency: Currency;
        public createdAt: any;

        ```

        Initializations: ```
        this.id        = +data.id || null;
        this.name      = data.name || null;
        this.surname   = data.surname || null;
        this.email     = data.email || null;
        this.age       = +data.age || null;
        this.isAdmin   = data.isAdmin !== undefined && data.isAdmin !== null ? Boolean(data.isAdmin) : null;
        this.currency  = data.currency || null;
        this.createdAt = data.createdAt || null;

        ```

        Data in `.spec.ts`: ```
        id:         1,
        name:       'Test string 1',
        surname:    'Test string 2',
        email:      'Test string 3',
        age:        2,
        isAdmin:    true,
        currency:   'No generator. Using some string 1',
        createdAt:  'Any as string 1',

        ```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 97.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~57 days

Total

2

Last Release

3460d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/11b715dbbb813e6d3cd3c1bba6a6f7b8af7ffb0aa9d1b1a46a11910a2c41cb45?d=identicon)[ancor.dev](/maintainers/ancor.dev)

---

Top Contributors

[![korniychuk](https://avatars.githubusercontent.com/u/11693557?v=4)](https://github.com/korniychuk "korniychuk (43 commits)")[![Ancor-dev](https://avatars.githubusercontent.com/u/180199345?v=4)](https://github.com/Ancor-dev "Ancor-dev (1 commits)")

### Embed Badge

![Health badge](/badges/anton-ng2-template/health.svg)

```
[![Health](https://phpackages.com/badges/anton-ng2-template/health.svg)](https://phpackages.com/packages/anton-ng2-template)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
