# sails-generate-angular2

> Generate TypeScript + Angular2.

Latest version **1.0.0** (published 2016-03-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install sails-generate-angular2
pnpm add sails-generate-angular2
yarn add sails-generate-angular2
bun add sails-generate-angular2
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-03-10 |
| First published | 2016-03-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Adam Sawicki |
| Maintainers | adamsawicki |
| Keywords | auth, generator, sails, generate, plugin, angular2, typescript |

## Links

- npm: https://www.npmjs.com/package/sails-generate-angular2
- Repository: https://github.com/frycz/sails-generate-angular2
- Homepage: https://github.com/frycz/sails-generate-angular2#readme
- Issues: http://github.com/frycz/sails-generate-anglar2/issues
- npm.io page: https://npm.io/package/sails-generate-angular2

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) >=2.4.x
- [merge-defaults](https://npm.io/package/merge-defaults.md) >=0.1.0

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-03-10

## README

# sails-generate-angular2

Typescript + Angular2 Sails.js generator

### Installation

In order to use a generator you will need the latest Sails, ~0.10, which can be installed with:

```sh
npm install sails -g
```

Once that's all set, install the generator:

```sh
$ npm install sails-generate-angular2
```

### Production Usage

##### On the command line

```sh
$ sails generate angular2
```

##### Install Angular2 and needed libs:

```sh
$ cd assets
$ npm install
```
##### Modify tasks/config/copy.js file:

```javascript
...
src: [
          '**/*.!(coffee|less|ts)',
          '!package.json',
          '!node_modules/**',
          'node_modules/es6-shim/**',
          'node_modules/systemjs/**',
          'node_modules/angular2/**',
          'node_modules/systemjs/**',
          'node_modules/rxjs/**',
          'node_modules/angular2/**'
        ],
...
```

##### Add dependencies to layout.ejs (or wherever you want :-)):

```html
    <script src="/node_modules/es6-shim/es6-shim.min.js"></script>
    <script src="/node_modules/systemjs/dist/system-polyfills.js"></script>

    <script src="/node_modules/angular2/bundles/angular2-polyfills.js"></script>
    <script src="/node_modules/systemjs/dist/system.src.js"></script>
    <script src="/node_modules/rxjs/bundles/Rx.js"></script>
    <script src="/node_modules/angular2/bundles/angular2.dev.js"></script>

    <script>
        System.config({
            map: {
                rxjs: '/node_modules/rxjs' // added this map section
            },
            packages: {
                app: {
                    format: 'register',
                    defaultExtension: 'js'
                },
                'rxjs': {defaultExtension: 'js'} // and added this to packages
            }
        });
        System.import('/app/main')
                .then(null, console.error.bind(console));
    </script>
```

##### Usage

```html
  <my-app></my-app>

```

##### Problems

Angular2 is still beta.


---

Copyright &copy; 2016 [Adam Sawicki](https://github.com/frycz). Licensed under the terms of the [MIT license](LICENSE.md).

---
_Source: https://npm.io/package/sails-generate-angular2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
