Adding Angular Material
Angular Material provides UI components based on Material Design for Angular. Thanks to the Angular CLI, you can install it in your project in a few steps.
Head back to your command-line interface and run the following command from the root of your project:
ng add @angular/material
You'll be prompted with The package @angular/material@12.2.8 will be installed and executed. Would you like to proceed? (Y/n)
. Type Y
and press Enter.
This will install the package from npm
. Next, the CLI will prompt you to Choose a prebuilt theme name, or "custom" for a custom theme
. Let's pick Indigo/Pink
. Next, it will ask Set up global Angular Material typography styles?
Type y
. Next, it will ask Set up browser animations for Angular Material?
Type y
.
That's it – you should have Angular Material installed and configured in your project.