Todo List Tutorial
Primary version
Primary version
  • Welcome to the ngGirls tutorial!
  • Workshop: Todo List
    • ๐Ÿ‘€About
    • #0: ๐Ÿ’ƒ Introduction
    • #1: โŒ› Installations
      • a. StackBlitz instructions
    • #2: ๐Ÿ…ฐ Angular kicks in
    • #3: ๐Ÿ“ Component
    • #4: โœ A new component
      • a. StackBlitz instructions
    • #5: ๐Ÿ’ผ Class
    • #6: ๐Ÿ“ฅ Property binding
    • #7: ๐Ÿ“คEvent binding
    • #8: ๐Ÿ“Ž Element ref - #
      • a. About
      • b. Explore
      • c. Resources
    • #9: ๐Ÿ“‹ The To Do list
    • #10: โž• New component: todo-item
    • #11: โ›“ Interface
      • a. StackBlitz instructions
    • #12: ๐Ÿ“ŒAdd items
    • #13: ๐Ÿšง Refactor App Component
    • #14: ๐Ÿ’… Adding Style
    • #15: ๐Ÿ”‹ Creating a Service
    • #16: ๐ŸŽ Add Items Using the Service
    • #17: ๐Ÿ’พLocal storage
    • #18: ๐Ÿ—‘ Remove item
    • #19: ๐Ÿ”˜ Adding a checkbox
    • #21: ๐Ÿ’ช Enrich the todo-item component
    • Appendix 1: Git and GitHub
    • Appendix 2: ๐Ÿ›ฐ Deploying your app
      • Deploy to Azure Static Web Apps
      • Deploy to GitHub Pages
        • a. StackBlitz instructions
    • Appendix 3: Tutorial Extensions
    • Appendix 4: Generating a new project
    • Troubleshooting
      • Installation
  • More Workshops
    • Second workshops - CRUD and HTTP
      • #1 MongoDB
      • #2 Local server
      • #3 http in diagrams
      • #4 POST
      • #5 GET
      • #6 DELETE and PUT
    • Gallery with Rx.js
      • #0: Init photo gallery
      • #1: Observable
      • #2: More interaction! Upload photos
      • #3: Merging Observables
      • #4: Filtering by category
      • #5: Adding photos to category
    • Forms
      • #1: Template-driven forms
      • #2: Reactive forms
      • #3: Form builder
    • NgRx
      • #1: Actions and reducers
      • #2: Store Devtools
      • #3: Implementing actions in app
      • #4: Selectors
    • RxJS
      • Operators
      • Play time!
    • Blog Editor
      • #1 โš™๏ธConfiguring firebase
      • #2 ๐Ÿ’…Add Angular Material
      • #3 ๐Ÿ’…Add Bootstrap
      • #4 ๐ŸงญAdd Navigation
      • #5 โœ๏ธAdd Editor
      • #6 โš™๏ธConnect Database
      • #6 ๐Ÿ’…Add Feed
      • #7 โœ๏ธEdit Post
      • #9 ๐Ÿš€Deploy
      • #10 โœ ๏ธNext Steps
Powered by GitBook
On this page
  • Add Angular Material packages
  • Add a material theme
  • Add a module for Angular material
  1. More Workshops
  2. Blog Editor

#2 ๐Ÿ’…Add Angular Material

Previous#1 โš™๏ธConfiguring firebaseNext#3 ๐Ÿ’…Add Bootstrap

Last updated 5 years ago

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 file as shown below.

import {BrowserAnimationsModule} from '@angular/platform-browser/animations';

@NgModule({
  ...
  imports: [
    ...
    BrowserAnimationsModule,
  ],
})

Some features of Angular material require HammerJS.

Import it into . This file is the entry point of our app.

import 'hammerjs';

Add a material theme

We will add a built-in material theme globally by including the following line in file.

@import  "~@angular/material/prebuilt-themes/indigo-pink.css";

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.

Import this new NgMaterialModule in ๐Ÿ“src/app/app.module.ts as shown below.

import { NgMaterialModule } from  './ng-material/ng-material.module';

@NgModule({
  ...
  imports: [
    ...
    NgMaterialModule,
  ],
})

Open src/app/ng-material/ng-material.module.ts and REPLACE what is there with the code in

src/app/app.module.ts
src/main.ts
src/styles.scss
ng-material.module.ts (Github)