12

I wanted to use angular material in an AngularJS application so I downloaded it with all its dependencies:

<script src="bower_components/hammer/hammer.js"></script>
<script src="bower_components/angular/angular.min.js"></script>
<script src="bower_components/angular-aria/angular-aria.min.js"></script>
<script src="bower_components/angular-animate/angular-animate.min.js"></script>
<script src="bower_components/angular-material/angular-material.min.js"></script>
<script src="bower_components/angular-route/angular-route.min.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script src="bower_components/angular-resource/angular-resource.min.js"></script>

And then I included it in my App:

var myApp = angular.module('myApp', ['ngRoute', 'ngResource', 'ngSanitize', 'ngMaterial', 'ngAnimate', 'ngAria']);

After that I wanted to try it on a button:

<md-container> <md-button>boutton1</md-button> </md-container>

And here is the result ( on Chrome and Firefox): enter image description here

And when I click on it I have this: enter image description here

Did I do something wrong?

2
  • Hammer.js is no longer required in the latest versions. Just FYI, not your problem though. Commented Mar 6, 2015 at 7:08
  • And one More thing i see You may need to add hammer.js under angular-materil.min.js Commented Jul 2, 2015 at 6:47

2 Answers 2

18

It looks like you are not including the stylesheet.

Try adding the following:

<link rel="stylesheet" href="bower_components/angular-material/angular-material.min.css" type="text/css">
Sign up to request clarification or add additional context in comments.

Comments

5

Alternatively, if you are using Angular CLI, you can insert this line @import "~@angular/material/prebuilt-themes/indigo-pink.css"; into your styles.css.

Just make sure to follow the official instructions https://material.angular.io/guide/getting-started

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.