mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
24 lines
592 B
TypeScript
24 lines
592 B
TypeScript
import { Router } from '@angular/router'
|
|
import { Injectable } from '@angular/core'
|
|
import { NavController } from '@ionic/angular'
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
export class PwaBackService {
|
|
constructor (
|
|
private readonly router: Router,
|
|
private readonly nav: NavController,
|
|
) { }
|
|
|
|
// this will strip an entry from the path on navigation
|
|
back () {
|
|
return this.nav.back()
|
|
// this.router.navigate()
|
|
// const path = this.router.url.split('/').filter(a => a !== '')
|
|
// path.pop()
|
|
// this.router.navigate(['/', ...path], { replaceUrl: false })
|
|
}
|
|
}
|
|
|