5

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.

2
  • 2
    Check out this website justindujardin.github.io/ng2-material Commented Dec 24, 2015 at 2:53
  • yes not all the components like angular 1.x are created using angular material for angular2 but few of them are created yet which is mentioned in the link proided by @EricMartinez Commented Dec 24, 2015 at 5:06

2 Answers 2

3

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}
Sign up to request clarification or add additional context in comments.

1 Comment

I know this answer is a long time ago. I tried using the Angular CLI 'ng new my-project', and i see at the cmd that is installing, but it take so long to install it looks like it never ends with installing. Does somebody have the same problem?
0

An alternative is use materialize from https://materializecss.com You just import this files into your index.html that is in src folder

<!-- Compiled and minified CSS -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/css/materialize.min.css">

    <!-- Compiled and minified JavaScript -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/js/materialize.min.js"></script>

thus you can use material design ex:

 <label>
    <input type="checkbox" />
    <span>Red</span>
  </label>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.