Tutorial by Examples

Requirements: NodeJS : Download page npm or yarn Run the following commands with cmd from new directory folder: npm install -g @angular/cli or yarn global add @angular/cli ng new PROJECT_NAME cd PROJECT_NAME ng serve Open your browser at localhost:4200
just use your cmd: You can use the ng generate (or just ng g) command to generate Angular components: Component: ng g component my-new-component Directive: ng g directive my-new-directive Pipe: ng g pipe my-new-pipe Service: ng g service my-new-service Class: ng g class my-new-classt...
In angular-cli.json you can change the app configuration. If you want to add ng2-bootstrap for example: npm install ng2-bootstrap --save or yarn add ng2-bootstrap In angular-cli.json just add the path of the bootstrap at node-modules. "scripts": [ "../node_modules/jqu...
In angular-cli.json at outDir key you can define your build directory; these are equivalent ng build --target=production --environment=prod ng build --prod --env=prod ng build --prod and so are these ng build --target=development --environment=dev ng build --dev --e=dev ng build --dev ng ...
The default style files generated and compiled by @angular/cli are css. If you want to use scss instead, generate your project with: ng new project_name --style=scss If you want to use sass, generate your project with: ng new project_name --style=sass
Yarn is an alternative for npm, the default package manager on @angular/cli. If you want to use yarn as package manager for @angular/cli follow this steps: Requirements yarn (npm install --global yarn or see the installation page) @angular/cli (npm install -g @angular/cli or yarn global add @an...

Page 1 of 1