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

View File

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