Code Monkey home page Code Monkey logo

Comments (5)

windcloak avatar windcloak commented on July 30, 2024 1

I have this in my Angular 9 code and it's swiping:

import 'hammerjs';

import { HammerModule } from '@angular/platform-browser';

import {
  HammerGestureConfig,
  HAMMER_GESTURE_CONFIG
} from '@angular/platform-browser';

export class MyHammerConfig extends HammerGestureConfig {
  overrides = {
    pinch: { enable: false },
    rotate: { enable: false } as any
  };
}

from ngx-gallery.

f3l1xss avatar f3l1xss commented on July 30, 2024

@windcloak I have already had that but still it wont swipe, by swiping I meant swiping with finger at touch screen:)

I have already put above configuration at my app.module.ts providers list:
providers: [
{ provide: HAMMER_GESTURE_CONFIG, useClass: CustomHammerConfig },
{ provide: HTTP_INTERCEPTORS, useClass: AjaxHeaderInterceptor, multi: true }
],

Are you able to post your app.module config? and the gallery config too perhaps? Thank you

from ngx-gallery.

windcloak avatar windcloak commented on July 30, 2024

app.module
https://github.com/windcloak/firecloak-web/blob/master/src/app/shared/module.ts

gallery component
https://github.com/windcloak/firecloak-web/blob/master/src/app/shared/components/cosplay-gallery/cosplay-gallery.component.ts

from ngx-gallery.

f3l1xss avatar f3l1xss commented on July 30, 2024

Have spent half day to resolve this turns out its just one line fix to import HammerModule as described here:

angular/angular#32203

By default Ivy (Angular 9) will NO longer include HammerSupport and thereby we have to import it manually at root.

@windcloak Thank you, had to went through your code to find out, I like your cosplay:)

And its no longer neccessary to create custom config like this:
providers: [
{ provide: HAMMER_GESTURE_CONFIG, useClass: CustomHammerConfig },
{ provide: HTTP_INTERCEPTORS, useClass: AjaxHeaderInterceptor, multi: true }
],

as well as to include hammer.js script at angular.json, swiping will work just by importing HammerModule

from ngx-gallery.

windcloak avatar windcloak commented on July 30, 2024

@f3l1xss Neat, I'll have to clean that up. Less code to mess with is definitely better.

from ngx-gallery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.