Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use angular material with angular 2?

I've tried npm install angular-material --save and followed the instructions here.

Then I added the script and 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 adding a simple <md-button> but am having no luck.

like image 254
monty_lennie Avatar asked Oct 19 '22 19:10

monty_lennie


1 Answers

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

See the Getting Started guide for installation instructions.

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

Since both projects are currently in alpha, the instructions below may change over time:

# 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}
like image 63
Mark Rajcok Avatar answered Nov 15 '22 06:11

Mark Rajcok