@Rithesh4i1hu wrote:
I have followed this issue for double tap Ionic - Double Tap? and tried to implement the same but getting error of undefined element, any idea what’s wrong. or any suggestion on implementing double-tap is appreciated
HTML code
<div *ngFor="let patner of member" style="display: inline-block;" padding-horizontal text-center class="images"> <img src="{{patner.photo_link}}" alt="" (dblclick)="user(patner.userId)" style="display: block;" #doubleEle> {{ patner.firstName}} </div>ts file code
@ViewChild('doubleEle') doubleEle:ElementRef; private pressGesture:Gesture; public ngAfterViewInit():void{ console.log(this.doubleEle); this.pressGesture = new Gesture(this.doubleEle.nativeElement); this.pressGesture.listen(); this.pressGesture.on('doubletap',(e:Event)=>{ console.log(e); }); };error
Error: Uncaught (in promise): TypeError: Cannot read property 'nativeElement' of undefined TypeError: Cannot read property 'nativeElement' of undefined at MyFamilyPage.webpackJsonp.115.MyFamilyPage.ngOnInit (my-family.ts:46)
Posts: 1
Participants: 1