- Angular Material 7 - Discussion
- Angular Material 7 - Resources
- Angular Material 7 - Quick Guide
- Angular Material 7 - Table
- Angular Material 7 - Sort Header
- Angular Material 7 - Paginator
- Angular Material 7 - Tooltip
- Angular Material 7 - SnackBar
- Angular Material 7 - Ripples
- Angular Material 7 - Progress Bar
- Angular Material 7 - Progress Spinner
- Angular Material 7 - Icons
- Angular Material 7 - Chips
- Angular Material 7 - Badge
- Angular Material 7 - Button Toggle
- Angular Material 7 - Button
- Angular Material 7 - Tree
- Angular Material 7 - Tabs
- Angular Material 7 - Stepper
- Angular Material 7 - List
- Angular Material 7 - Grid List
- Angular Material 7 - Expansion Panel
- Angular Material 7 - Divider
- Angular Material 7 - Card
- Angular Material 7 - Tool Bar
- Angular Material 7 - Side Nav
- Angular Material 7 - Menu
- Angular Material 7 - Toggle Slider
- Angular Material 7 - Slider
- Angular Material 7 - Select
- Angular Material 7 - Radio Button
- Angular Material 7 - Input
- Angular Material 7 - Form Field
- Angular Material 7 - Date Picker
- Angular Material 7 - Check Box
- Angular Material 7 - Auto-Complete
- Environment Setup
- Angular Material 7 - Overview
- Angular Material 7 - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Angular Material 7 - Environment Setup
This tutorial will guide you on how to prepare a development environment to start your work with Angular Framework and Angular Material. In this chapter, we will discuss the Environment Setup required for Angular 6. To install Angular 6, we require the following −
Nodejs
Npm
Angular CLI
IDE for writing your code
Nodejs has to be greater than 8.11 and npm has to be greater than 5.6.
Nodejs
To check if nodejs is installed on your system, type node -v in the terminal. This will help you see the version of nodejs currently installed on your system.
C:>node -v v8.11.3
If it does not print anything, install nodejs on your system. To install nodejs, go the homepage
of nodejs and install the package based on your OS.The homepage of nodejs will look pke the following −
Based on your OS, install the required package. Once nodejs is installed, npm will also get installed along with it. To check if npm is installed or not, type npm -v in the terminal. It should display the version of the npm.
C:>npm -v 5.6.0
Angular 6 installations are very simple with the help of angular CLI. Visit the homepage
of angular to get the reference of the command.Type npm install -g @angular/cp, to install angular cp on your system.
You will get the above installation in your terminal, once Angular CLI is installed. You can use any IDE of your choice, i.e., WebStorm, Atom, Visual Studio Code, etc.
Install Angular Material
Run the following command to install Angular Material module and its related components in the project created.
materialApp>npm install --save @angular/material @angular/cdk @angular/animations hammerjs + @angular/animations@6.1.10 + @angular/cdk@7.0.3 + @angular/material@7.0.3 + hammerjs@2.0.8 added 4 packages and updated 1 package in 39.699s
Add the following entry in app.module.ts file
import {BrowserAnimationsModule} from @angular/platform-browser/animations ; import {FormsModule, ReactiveFormsModule} from @angular/forms ; imports: [ ... FormsModule, ReactiveFormsModule, BrowserAnimationsModule ],
Add the following entry in styles.css file to get a theme.
@import "~@angular/material/prebuilt-themes/indigo-pink.css";
Add the following entry in index.htm file to get a material icons support.
<pnk href = "https://fonts.googleapis.com/icon?family=Material+Icons" rel = "stylesheet">Advertisements