Components: Slide-toggle is not working

Created on 12 Aug 2016  Â·  12Comments  Â·  Source: angular/components

Bug, feature request, or proposal:

This is the error showing on console of browser (google chrome latest)
EXCEPTION: Error: Uncaught (in promise): EXCEPTION: Error in ./MdSlideToggle class MdSlideToggle - inline template:0:783
ORIGINAL EXCEPTION: Hammer.js is not loaded, can not bind slidestart event
ORIGINAL STACKTRACE:
Error: Hammer.js is not loaded, can not bind slidestart event
at new BaseException$1

What is the expected behavior?

Hammer.js should be automatically loaded

What is the current behavior?

hammer.js is not loading so slide-toggle is not working

What are the steps to reproduce?

All package of angular material are working except this
I have use in this way .

What is the use-case or motivation for changing an existing behavior?

Which versions of Angular, Material, OS, browsers are affected?

angular version :RC 5
angular material :+1: 2.0.0-alpha.7-2

Is there anything else we should know?

Also buttons are increasing on scroll height on click

Most helpful comment

I thinking polyfills.ts is the right place to place import 'hammerjs';

All 12 comments

@ashokacharya did you do additional setup for md-slide-toggle ?

Thank you for info

how to deal it,I still can not work @ashokacharya

@lizardd go to your main component and import 'hammerjs'.
This solved it for me.
Check also here: #977

very thank you。 @vapits

@vapits, thank you so much. That did it for me; and I've been searching for answers for weeks.

import 'hammerjs' in my main main component solved the problem for me too.
Thanks @vapits !

THANKS! @vapits !!!

I thinking polyfills.ts is the right place to place import 'hammerjs';

checkbox is appearing along with slider toggel.and css also not applying.For this I followed https://github.com/angular/material2/blob/master/guides/getting-started.md
see the Image this is the problem.
ngmaterialui

Thanks In advance
Rajasree

checkbox is appearing along with slider toggel.and css also not applying.For this I followed https://github.com/angular/material2/blob/master/guides/getting-started.md
see the Image this is the problem.
ngmaterialui

Thanks In advance
Rajasree

I had the same issue, to fix that just add the follow import in your style.css/scss:
@import "../node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css";

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

crutchcorn picture crutchcorn  Â·  3Comments

savaryt picture savaryt  Â·  3Comments

alanpurple picture alanpurple  Â·  3Comments

jelbourn picture jelbourn  Â·  3Comments

MurhafSousli picture MurhafSousli  Â·  3Comments