toggle status lists

This commit is contained in:
Jesse Lucas
2020-03-11 21:24:02 -04:00
parent 61b4de581d
commit cf3de8cf35
5 changed files with 29 additions and 19 deletions
@@ -1,4 +1,4 @@
<mat-button-toggle-group name="fontStyle" aria-label="Font Style">
<mat-button-toggle value="folders" (click)="onSelect(toggleAction.Folders)">Folders</mat-button-toggle>
<mat-button-toggle value=" devices" (click)="onSelect(toggleAction.Devices)">Devices</mat-button-toggle>
<mat-button-toggle-group name="fontStyle" aria-label="Font Style" value="folders">
<mat-button-toggle value="folders" (click)="onSelect(status.Folders)">Folders</mat-button-toggle>
<mat-button-toggle value="devices" (click)="onSelect(status.Devices)">Devices</mat-button-toggle>
</mat-button-toggle-group>
@@ -1,9 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
import { Status } from '../status';
export enum ToggleAction {
Folders = 1,
Devices,
}
@Component({
selector: 'app-status-toggle',
@@ -12,20 +10,20 @@ export enum ToggleAction {
})
export class StatusToggleComponent implements OnInit {
public toggleAction = ToggleAction
constructor() { }
public status = Status
@Output() statusEvent = new EventEmitter<Status>();
constructor() { }
ngOnInit(): void {
}
onSelect(label: ToggleAction): void {
console.log("here?");
switch (label) {
case ToggleAction.Folders:
onSelect(s: Status): void {
this.statusEvent.emit(s);
switch (s) {
case Status.Folders:
console.log("folder action");
break;
case ToggleAction.Devices:
case Status.Devices:
console.log("Device action");
break;
}