| Start |
|---|
| Create empty Angular2 application with angular-cli Requirements: Run the following commands with cmd from new directory folder:
Open your browser at localhost:4200 |
| Generating Components, Directives, Pipes and Services just use your cmd: You can use the ng generate (or just ng g) command to generate Angular components:
|
| Adding 3rd party libs In angular-cli.json you can change the app configuration. If you want to add ng2-bootstrap for example: |
| build with angular-cli In angular-cli.json at outDir key you can define your build directory; these are equivalent and so are these When building you can modify base tag () in your index.html with --base-href your-url option. Sets base tag href to /myUrl/ in your index.html |
| New project with scss/sass as stylesheet The default style files generated and compiled by If you want to use scss instead, generate your project with: If you want to use sass, generate your project with: |
| Set yarn as default package manager for @angular/cli 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
To set yarn as @angular/cli package manager:
To set back npm as @angular/cli package manager:
|
Read Article
https://develop.horje.com/learn/1434/reference