add back button in edit pages (#96)
closes #89 Reviewed-on: #96
This commit was merged in pull request #96.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { Location } from '@angular/common';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
@@ -31,7 +32,8 @@ export class EditAllowancePage implements OnInit {
|
||||
private route: ActivatedRoute,
|
||||
private formBuilder: FormBuilder,
|
||||
private allowanceService: AllowanceService,
|
||||
private router: Router
|
||||
private router: Router,
|
||||
private location: Location
|
||||
) {
|
||||
this.userId = this.route.snapshot.params['id'];
|
||||
this.goalId = this.route.snapshot.params['goalId'];
|
||||
@@ -98,4 +100,8 @@ export class EditAllowancePage implements OnInit {
|
||||
this.allowanceService.deleteAllowance(this.goalId, this.userId);
|
||||
this.router.navigate(['/tabs/allowance', this.userId]);
|
||||
}
|
||||
|
||||
navigateBack() {
|
||||
this.location.back();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user