Angular Material UI
Mohammad Jawad barati
Software Engineer | Fullstack Engineer | Microservices | TS/JS | Python | IaC | AWS | TDD | BDD | Automation | CI/CD
IMO you need to know 3 things before reading this article:
So let me begin with elaborating its definition:
CDK stands for Component Dev Kit
Which is a set of behavior for building UI components.
Now to install Angular material do this:
ng add @angular/material
When you run this command it will asks you - It did in v14 - to set up global Angular Material typography style or not. But before going forward I like to say what does it means exactly.
领英推荐
As you can see when we say yes it will add the class in index.html - The main HTML file. This is how it applies the typography globally. Now the second question rises, Do you want to include Angular animations? Let's break this one into simpler parts:
Create angular-material module
To keep out AppModule clean and neat I prefer to create a new module for Angular Material UI imports. Note that --module tells cli to auto import it in AppModule and basically I like to delegate tedium boring foolish tasks to the CLI.
ng generate module angular-material --module app
As I said most of tasks done by CLI an finally we just need to do one thing in AppModule; adding schemas: [CUSTOM_ELEMENTS_SCHEMA], in the @NgModule.
<my-good-tag weird-prop="value">
Hello
</my-good-tag>