components icon indicating copy to clipboard operation
components copied to clipboard

Slide-toggle is not working

Open ashokacharya opened this issue 10 years ago • 12 comments

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 . <md-slide-toggle [color]="'primary'" >

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

ashokacharya avatar Aug 12 '16 02:08 ashokacharya

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

m0t0r avatar Aug 12 '16 03:08 m0t0r

Thank you for info

ashokacharya avatar Aug 12 '16 03:08 ashokacharya

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

lizardd avatar Aug 18 '16 11:08 lizardd

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

vapits avatar Aug 18 '16 13:08 vapits

very thank you。 @vapits

lizardd avatar Aug 19 '16 02:08 lizardd

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

NaijaProgrammer avatar Oct 10 '16 12:10 NaijaProgrammer

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

mahmoudmahdi24 avatar Nov 10 '16 13:11 mahmoudmahdi24

THANKS! @vapits !!!

gkernen avatar Nov 24 '16 01:11 gkernen

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

kuncevic avatar Dec 05 '16 04:12 kuncevic

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

Rajasree37 avatar Jun 29 '17 09:06 Rajasree37

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";

felipedamiani avatar Dec 28 '18 19:12 felipedamiani

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.