Prabhakaran
Prabhakaran

Reputation: 1544

Angular2 Material ripple effect is not working

I am using Angular2 material. Installed and imported @angular/material @angular/cdk.

<button md-button>Click me</button>

This gives me proper button with respective material CSS. But ripple doesn't work. So I tried adding

<button md-button md-ripple>Click me</button>

It ends like this enter image description here

How to apply ripple effect, is there any proper guidelines. I wish to achieve ripple effect without using the angular material default themes

Upvotes: 2

Views: 4269

Answers (1)

FAISAL
FAISAL

Reputation: 34673

You are missing the material theme for your app. For a test, in your index.html, add the following link:

<link href="https://rawgit.com/angular/material2-builds/master/prebuilt-themes/indigo-pink.css" 
rel="stylesheet">

if the ripple works, then you can add the theme to your app by following this guideline: Theming your Angular Material app

Upvotes: 4

Related Questions