David Muellerchen
David Muellerchen is a trainer at AngularJS.DE. He loves to speak and teach at meetups and conferences. During leisure time he jumps through the parks with his kids or rides his racer. He a
unleash the power of angular 2
David Müllerchen
Developer since 10 Years
Since 2 Years at acando
Vanila.js, jQuery, Bootstrap, Angularjs, Angular Material, Angular 2
node.js, mysql, mssql, php
Blog: https://www.webdave.de/
Github: https://github.com/web-dave/
Twitter: @webdave_de
code generator
Build tool
dev environment
devOps
Handle all your dependencies
Blackbox the Project settings for easy use
Makes it easy to follow the styleguide
You need (as normal) node and npm installed
Install angular-cli
npm install -g angular-cli@webpack
ng v
// or
ng version
// angular-cli: 1.0.0-beta.11-webpack.2
// node: 6.4.0
// os: win32 x64
Note:
The angular-cli team followed the user request and moved from broccoli/SystemJS to webpack to make it easier to use.
//cd into your workspace
cd workspace
//scaffold your project
ng new hello-cli
//handle issue #1528
cd hello-cli
npm i --save-dev angular-cli@webpack
IMPORTANT NOTE:
Currently project generated with ng new will use a wrong local CLI version (issue#1528).
After initializing your project, run npm install --save-dev angular-cli@webpack to set the correct version.
//cd into your workspace
cd workspace
//create a Projectfolder
mkdir hello-cli
// optional you can config a (one) CSS preprocessor
// --style=scss
// --style=sass
// --style=less
// --style=styl
ng init --style=scss
this step takes some time
ng serve
http://localhost:4200/
Custom or 3rd party libs comes here
Our dev folder
//ng g
//ng generate component [<path-to-component>/]<component-name>
//Component
ng g component top-nav
component
//ng g
//ng generate directive [<path-to-directive>/]<directive-name>
//Directive
ng g directive my-directive
directive
//ng g
//ng generate pipe [<path-to-pipe>/]<pipe-name>
//Pipe
ng g pipe my-pipe
pipe
//ng g
//ng generate service [<path-to-service>/]<service-name>
//Pipe
ng g service my-service
service
//unit test using Karma and jasmine
ng test
//e2e test using protractor
ng serve
ng e2e
// build dev
ng build
//build prod (minimized)
ng build --prod
ng help
https://cli.angular.io/
install 3rd party lib via npm and angular-cli.json
ng g route <route>
By David Muellerchen
David Muellerchen is a trainer at AngularJS.DE. He loves to speak and teach at meetups and conferences. During leisure time he jumps through the parks with his kids or rides his racer. He a