Configuring Material and Styles

We will also need to set up Angular Material and configure a theme to use, as covered in Chapter 5, Enhance Angular App with Angular Material:

  1. Install Angular Material:
$ npx ng add @angular/material
$ npm i @angular/flex-layout hammerjs
$ npx ng g m material --flat -m app
  1. Import and export MatButtonModule, MatToolbarModule, and MatIconModule
  2. Configure your default theme and register other Angular dependencies
  3. Add common css to styles.css as shown below,
src/styles.css

body {
margin: 0;
}

.margin-top {
margin-top: 16px;
}

.horizontal-padding {
margin-left: 16px;
margin-right: 16px;
}

.flex-spacer {
flex: 1 1 auto;
}

Refer to Chapter 5, Enhance Angular App with Angular Material, for further configuration details.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.148.104.124