@Amit said it well
That is because, there is no dblclick event registered for mobile devices.
Here is kind of the same solution, but the RxJS way:
HTML:
<a (dblclick)="click$.next(item.id)">View Record Details</a>
Component:
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Subject } from 'rxjs';
import { buffer, debounceTime, map, filter } from 'rxjs/operators';
export class SomeComponent implements OnInit {
click$ = new Subject<number>();
doubleClick$ = this.click$.pipe(
buffer(this.click$.pipe(debounceTime(250))),
map(list => ({ length: list.length, id: list[list.length - 1] })),
filter(item => item.length === 2),
map(item => item.id)
);
ngOnInit() {
this.doubleClick$.subscribe((id) => this.viewRecord(id));
}
viewRecord(id) {
this.router.navigate(['course/view/', id]);
}
}
StackBlitz DEMO