How to Install Angular 5 from Visual Studio Code
Prerequisites
You're going to need a couple things before proceeding:
- Node.js
- Node Packange Manager (NPM)
Installing Angular 5 through the CLI
The Angular CLI (Command Line Interface) is the quickest and easiest way to get started with a brand new Angular 5 project.
Install CLI
npm install -g @angular/cli@latest
Check Versions
ng --version
npm -v
node -v
Install TypeScript
npm install -g typescript
npm install -g typescript
Create New Project
ng new my-new-project --style=scss --routing
The two flags we added at the end specify that we want the CSS to use the Sass compiler, and --routing tells the CLI to provide us with the routing scaffolding.
Install Bootstrap 4
We need to install bootstrap and ngx-bootstrap to use the bootstrap for the Angular 5 project.
npm install bootstrap@next --save
npm install bootstrap ngx-bootstrap --save
Generate Modules to new project
Shared is the Module Name
ng g module shared (or)
ng generate module shared
Generate Components
ng generate component home --module='app.module.shared.ts'
ng generate component home --skip-import=true
ng generate module app-routing --flat --module=app
More Info: https://www.npmjs.com/package/angular-cli
0 comments: