got to the previous page in history after device was added

pull/3/head
Chris Veilleux 2019-03-23 18:41:31 -05:00
parent 4a5a146536
commit 21ae056716
2 changed files with 131 additions and 132 deletions

View File

@ -1,4 +1,3 @@
<!-- Show a horizontal stepper on larger devices -->
<mat-horizontal-stepper *ngIf="!alignVertical" labelPosition="bottom">
<!-- Use font awesome icons in the stepper to indicate progress -->
@ -59,7 +58,7 @@
<account-device-add-complete [wakeWord]="deviceForm.controls['wakeWord'].value">
</account-device-add-complete>
<div fxLayout="row" fxLayoutAlign="end">
<button mat-button>FINISHED</button>
<button mat-button (click)="onFinished()">FINISHED</button>
</div>
</mat-step>
</mat-horizontal-stepper>
@ -124,7 +123,7 @@
<account-device-add-complete [wakeWord]="deviceForm.controls['wakeWord'].value">
</account-device-add-complete>
<div fxLayout="row" fxLayoutAlign="end">
<button mat-button>FINISHED</button>
<button mat-button (click)="onFinished()">FINISHED</button>
</div>
</mat-step>
</mat-vertical-stepper>

View File

@ -1,18 +1,14 @@
import { Component, OnInit } from '@angular/core';
import { MediaChange, MediaObserver } from '@angular/flex-layout';
import {
FormBuilder,
FormGroup,
Validators
} from '@angular/forms';
import {FormBuilder, FormGroup, Validators } from '@angular/forms';
import { ActivatedRoute } from '@angular/router';
import { faCheck } from '@fortawesome/free-solid-svg-icons';
import { Subscription } from 'rxjs';
import { AccountPreferences } from '../../../../shared/models/preferences.model';
import { DeviceService } from '../../../../core/http/device.service';
import { AccountDefaults } from '../../../../shared/models/defaults.model';
import { AccountDefaults } from '@account/models/defaults.model';
import { AccountPreferences } from '@account/models/preferences.model';
import { DeviceService } from '@account/http/device.service';
@Component({
selector: 'account-device-add',
@ -114,4 +110,8 @@ export class DeviceAddComponent implements OnInit {
onDefaultsSubmit() {
this.deviceService.addAccountDefaults(this.defaultsForm).subscribe();
}
onFinished() {
window.history.back();
}
}