How can I use angular material with angular 2?

I tried npm install angular-material --saveand followed the instructions here.

Then I added a script and a link to index.html

<script src="node_modules/angular-material/index.js"></script>
<link ref="stylesheet" href="node_modules/angular-material/modules/angular-material.css">

Then I tried to add a simple one <md-button>, but I had no luck.

+4
source share
1 answer

Since this question was written, the Angular team created a gentub project for the Angular 2 project " https://github.com/angular/material2

Refer to the Getting Started Installation Guide .

They want you to (install and) use the Angular CLI .

, :

# install the CLI globally
npm install -g angular-cli

# create a new project
ng new my-project

# install Angular Material 2 components
npm install --save @angular2-material/{core,button,card}
+3

Source: https://habr.com/ru/post/1621561/


All Articles