Angular Material - Angular Material Environmental Setup - Angular Material Tutorial
Environmental Setup for Angular Material
- There are two ways to use Angular Material.
- They are:
- Local Installation - You can download the Angular Material libraries using npm, jspm, or bower on your local machine and include it in your HTML code.
- CDN Based Version - You can include the angular-material.min.css and angular-material js files into your HTML code directly from the Content Delivery Network (CDN).
angular material tutorials - Interactive Output Example
Related Tags - angular material , angular 2 material , angular material 2 , angular material design , material angular
Local Installation:
- Before use the following npm command, it should require NodeJS installation on system. To get information about nodeJS,
- Open NodeJS command line interface use the following command to install Angular Material libraries.
Syntax:
- npm will download the files under node_modules > angular-material folder.
Example:
- Now you can include the css and js file in your HTML file.
- It will produce the following result -
Output:
CDN Based Version:
- This version includes the angular-material.css and angular-material.js files into your HTML code directly from the Content Delivery Network (CDN).
Example:
- We can write the above example by using angular-material.min.css and angular-material.min.js with the Google CDN.
- It will produce the following result −