Mudanças entre as edições de "Installing Angular Material"

De Basef
Ir para: navegação, pesquisa
Linha 2: Linha 2:
  
  
1) Install Angular Material
+
'''1) Install Angular Material'''
 
<source lang="bash">
 
<source lang="bash">
 
npm install --save @angular/material
 
npm install --save @angular/material
Linha 19: Linha 19:
 
</source>
 
</source>
  
 +
Add '''MaterialModule''' module to '''imports''' section of '''NgModule'''.
  
2) You may also need to import Angular Animations:
+
 
 +
'''2) You may also need to import Angular Animations:'''
  
 
<source lang="bash">
 
<source lang="bash">
Linha 32: Linha 34:
 
</source>
 
</source>
  
 +
Add '''BrowserAnimationsModule''' module to '''imports''' section of '''NgModule'''.
  
3) And also gestures library:
+
 
 +
'''3) And also gestures library:'''
  
 
<source lang="bash">
 
<source lang="bash">
Linha 46: Linha 50:
  
  
4) Also, you may install Angular Flex layout:
+
'''4) Also, you may install Angular Flex layout:'''
 
<source lang="bash">
 
<source lang="bash">
 
npm install --save @angular/flex-layout
 
npm install --save @angular/flex-layout
Linha 54: Linha 58:
 
import { FlexLayoutModule } from '@angular/flex-layout';
 
import { FlexLayoutModule } from '@angular/flex-layout';
 
</source>
 
</source>
 +
 +
Add '''FlexLayoutModule''' module to '''imports''' section of '''NgModule'''.
 +
  
 
[[Category: AngularJS2]]
 
[[Category: AngularJS2]]

Edição das 14h35min de 26 de abril de 2018

Angular Material has some great components ready to use in your project: https://material.angular.io/


1) Install Angular Material

npm install --save @angular/material

Go to your index.html and add this inside <head>:

<link href="https://fonts.goggleapis.com/icon?family=Material+Icons" rel="stylesheet" />

Go to your modules file and import MaterialModule:

import { MaterialModule } from '@angular/material';

Add MaterialModule module to imports section of NgModule.


2) You may also need to import Angular Animations:

npm install --save @angular/animations

Go to your modules file and import BrowserAnimationsModule:

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

Add BrowserAnimationsModule module to imports section of NgModule.


3) And also gestures library:

npm install --save hammerjs

Go to your modules file and import BrowserAnimationsModule:

import 'hammerjs';


4) Also, you may install Angular Flex layout:

npm install --save @angular/flex-layout
import { FlexLayoutModule } from '@angular/flex-layout';

Add FlexLayoutModule module to imports section of NgModule.