question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Slider HammerGestures Are Not Recognised in Lazy-Loaded Component

See original GitHub issue

Bug, feature request, or proposal:

Bug

What is the expected behavior?

The slider’s hammer gesture should be recognised in lazy-loaded component.

What is the current behavior?

The slider’s hammer gestures ( slideStart, slideEnd and slide ) are not recognised in lazy-loaded component.

If MatSliderModule is imported in AppModule, it works fine. But if MatSliderModule is imported in a LazyLoadedModule, hammer js gestures are not recognised.

Here is the demo.

What are the steps to reproduce?

Providing a StackBlitz/Plunker (or similar) is the best way to get the team to see your issue.
Plunker starter (using on @master): https://goo.gl/uDmqyY
StackBlitz starter (using latest npm release): https://goo.gl/wwnhMV

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

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

Is there anything else we should know?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
DanielYKPancommented, Nov 3, 2017

@jelbourn So if I load MatSliderModule in my Lazy-Loaded Module, I need to added

{provide: HAMMER_GESTURE_CONFIG, useClass: GestureConfig}

in my AppModule? Is this what you mean in you short term?

Thanks, man

1reaction
jelbourncommented, Nov 3, 2017

See https://github.com/angular/angular/issues/19874

It’s currently a limitation of Angular that event plugins must be created at bootstrap time. In the short term, you can add a provider just for the Hammer gesture config without needing any of the component modules:

{provide: HAMMER_GESTURE_CONFIG, useClass: GestureConfig}
Read more comments on GitHub >

github_iconTop Results From Across the Web

LazyLoad “exclude” not working on Chrome? - WordPress.org
When LazyLoad is activated, the slider doesn't work properly as the pictures are not loaded correctly and they all get shifted outside of...
Read more >
Angular 4 subscribe not working in lazyload - Stack Overflow
When lazy loading a module, the module providers are re-created. So the components inside that module will get a new instance of the...
Read more >
Lazy Loading Images – The Complete Guide - ImageKit.io
For images it usually translates to any image that is not visible to the user up front can be lazy loaded. As the...
Read more >
Lazy Load Vue.js Components When They Become Visible
In the video above, you can see how components are not loaded until they become visible. Initially, only a gray placeholder box is...
Read more >
How to Lazy Load Images on Shopify to Make Your Site Faster
We can usually lazy load videos as well (if they're not at the top of the page). Option B) If enjoy working with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found