#2 ๐ Add Angular Material
Angular Material is a UI (User Interface) component library that can help you to style your application based on modern web design principles. The following steps show you how to get started with Angular Material.
Add Angular Material packages
Import the Browser Animation Module into src/app/app.module.ts
file as shown below.
Some features of Angular material require HammerJS
.
Import it into src/main.ts
. This file is the entry point of our app.
Add a material theme
We will add a built-in material theme globally by including the following line in src/styles.scss
file.
Add a module for Angular material
We will create a new module to include all the material related components. Right click on the ๐ng-material
folder and navigate to 'Angular Generator' and select 'Module'. Then provide the name ng-material
for our new module.
Open src/app/ng-material/ng-material.module.ts
and REPLACE what is there with the code in ng-material.module.ts (Github)
Import this new NgMaterialModule
in ๐src/app/app.module.ts
as shown below.
Last updated
Was this helpful?