Files
start-os/ui/src/app/services/pwa-back.service.ts
Aiden McClelland 95d3845906 0.2.5 initial commit
Makefile incomplete
2020-11-23 13:44:28 -07:00

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 })
}
}