Jan*_*S91 3 html hammer.js angular
我注意到指令(swipeup)似乎没有起作用:我尝试过使用(swipeleft)并且有效:
<div [@myAnimation] (swipeup)="showActionBar = false" fxFlex="56px" *ngIf="showActionBar" fxLayoutWrap fxLayoutAlign="start center"fxLayoutGap="8px" class="overview-actions">
Run Code Online (Sandbox Code Playgroud)
有没有人有解决方案/解决方案.我看了,但没有找到与我的问题相关的解决方案.
谢谢你,J.
Jay*_*ase 11
您可以从@ angular/platform-browser导入锤子配置并覆盖它.默认情况下,向上和向下滑动都会关闭,因为它们会在用户尝试滚动时导致问题.
app.module.ts
import * as Hammer from 'hammerjs';
import { HammerGestureConfig, HAMMER_GESTURE_CONFIG } from '@angular/platform-browser';
export class HammerConfig extends HammerGestureConfig {
overrides = <any>{
'swipe': { direction: Hammer.DIRECTION_ALL }
};
}
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule
],
providers: [
{
provide: HAMMER_GESTURE_CONFIG,
useClass: HammerConfig
}
],
bootstrap: [AppComponent]
})
export class AppModule { }
Run Code Online (Sandbox Code Playgroud)