New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

generator-an2

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generator-an2

A generator for creating and scafolding AngularJS 2 basic application

latest
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

AngularJS 2 Generator

ngloveyo

AngualarJS 2.0 knew a tramadic changes over the pat nonths and for that matter, new concept have been introduced and one of them is the Component.

And so we have the normal way and it's by creating the file it self and make the needed addiction and configure everything with your app and then you install a live server that let you Launch your application i don't know about you but this process is really teades for me personally.So and because of that i've created AN2 Generator.

Usage :

In order to have a full complete vision please check out this article.

AN2 - Starter Article

Or just follow the steps bellow :

1 - Install Yo , Bower , Grunt-Cli and for our case we will use Gulp you will find a development version bundled with the end result but yu ned to instal it in your development machine :

 $ npm install -g bower  grunt-cli  gulp  yo

2 - Make yourself a working directory where you will scaffold your application, in direct or through command-line :

 $ mkdir dev-code 

3 - Simply Run the following command:

 $ yo an2

Notice :

In this version of the app we will assume that you will work using TypeScriptthat's why all the generated fiels will be in TypeScript

import {Component} from 'angular2/angular2';

@Component({
  selector : 'my-app',
  template : '<span>Hello world !</span>',
})

export class componentName {
  public hello : string = 'Hello !';
}

Sub-Generator :

For this matter we introduced the cmp sub generator, thi last will be responsible of creating the 3 different kind of files : .ts & .html & .css, and all that will be in a supported naming convention for th overall file name : componentName.Component.ts/html/css or just a plane naming componentName.ts\html\css. Using this command :

$ yo an2:cmp hero 

Where :

1 - an2 : is the name of the generator.

2 - cmp : is yeoman way to launh the sub generator, and in our case it's called : cmp and the : is critical.

Launching the Application :

AN2 Generator comes with pre-configuration files and we use live-server and the tsc the TypeScript compiler and it will run using the following commands

$ npm start #In order to launch the Liver-Server module.

And :

$ npm run tsc #In order to launch the TypeScript Compiler.

Changelog

Recent changes can be viewed on Github on the Releases Page

License

BSD license

Keywords

ES6

FAQs

Package last updated on 03 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts