02-Configuring Your Angular Application
02-Configuring Your Angular Application
Angular Application
Objectives and Outcomes
In this exercise we will set up our project to use Angular Material and Angular Flex Layout. We will
then introduce our first Angular Material component into our application. At the end of this exercise
you will be able to:
Configure your Angular project to use Angular Material and Flex Layout.
To configure your project to use Angular material, type the following at the
prompt to install Angular Material, Angular Animations and HammerJS:
Next, include the following into the <head> of index.html to make use of
Material Design icons:
="stylesheet">
Updating AppModule
Then, you need to import the Angular Animations Module, Angular Material
Module, Flex Layout Module and hammerjs into your root module
(src/app/app.module.ts) as follows:
. . .
import 'hammerjs';
@NgModule({
. . .
imports: [
. . .,
BrowserAnimationsModule,
MaterialModule,
FlexLayoutModule
],
. . .
})
. . .
Adding Styles
Add the following styles to styles.scss file:
@import '~@angular/material/prebuilt-themes/deeppurple-amber.css';
body {
padding: 0;
margin: 0;
Conclusions
In this exercise we learnt to use Angular Material and Flex Layout NgModules in our Angular
application.