Install and Configure a Project with Angular Material

InstructorBrian Troncone

Share this video with your friends

Send Tweet

This lesson demonstrates the basic project setup required to get started with Angular Material. Required and suggested packages are discussed as well as custom material module and theme setup.

Brendan Whiting
~ 7 years ago

0:59 it shows the css file as "pink-bluegray.css". This file didn't exist for me and I needed to change the spelling to 'grey' instead of 'gray'

whisher
~ 7 years ago

Hi there, just to point out in the repo there is only master branch and not a branch for lesson. Imho bad idea to put sidebar component in the first lesson (its not easy to follow as first component)

xuan
~ 6 years ago

where you define tag mat-toolbar in the app.components.ts thanks

xuan
~ 6 years ago

i got this error when follow your instruction:

ERROR in ./src/styles.css (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./src/styles.css) Module build failed (from ./node_modules/postcss-loader/src/index.js): Error: Failed to find '@angular/material/prebuilt-themes/pink-bluegray.css' in [ C:\Users\xuan tran\my-app\src ] at resolveModule.catch.catch (C:\Users\xuan tran\my-app\node_modules\postcss-import\lib\resolve-id.js:35:13) at <anonymous> i 「wdm」: Failed to compile.

xuan
~ 6 years ago

this is the whole process: $ npm start

my-app@0.0.0 start C:\Users\xuan tran\my-app ng serve

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

Date: 2019-03-19T08:59:04.226Z Hash: 799e3aaa780b5db482c0 Time: 12792ms chunk {es2015-polyfills} es2015-polyfills.js, es2015-polyfills.js.map (es2015-polyfills) 284 kB [initial] [rendered] chunk {main} main.js, main.js.map (main) 11.5 kB [initial] [rendered] chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 236 kB [initial] [rendered] chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered] chunk {styles} styles.js, styles.js.map (styles) 16.2 kB [initial] [rendered] chunk {vendor} vendor.js, vendor.js.map (vendor) 3.76 MB [initial] [rendered]

ERROR in ./src/styles.css (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./src/styles.css) Module build failed (from ./node_modules/postcss-loader/src/index.js): Error: Failed to find '@angular/material/prebuilt-themes/pink-bluegray.css' in [ C:\Users\xuan tran\my-app\src ] at resolveModule.catch.catch (C:\Users\xuan tran\my-app\node_modules\postcss-import\lib\resolve-id.js:35:13) at <anonymous> i 「wdm」: Failed to compile.

xuan
~ 6 years ago

After installing material component inside vs code.I still get that error

xuan
~ 6 years ago

where dp i get this css file: @angular/material/prebuilt-themes/pink-bluegray.css

System
~ 5 years ago

maybe this will works: @import "~@angular/material/prebuilt-themes/indigo-pink.css";