Issue
I am trying to using hammer js in ionic angular project.
I have imported hammermodule in my component's module:
import { BrowserModule, HammerModule } from '@angular/platform-browser';
//...
@NgModule({
imports: [
BrowserModule,
HammerModule,
//...
]})
And imported hammerjs inside the component as per docs. But no event is triggered.
<div (swipeleft)="onswipe(i)">swipe me</div>
onswipe(x){
console.log(x,'triggered')
}
Solution
HammerModule should be imported inside AppModule(not inside child modules).
You can import 'hammerjs' inside the components.
Answered By - saravana priyan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.