diff --git a/src/app/status-list/status-list.component.html b/src/app/status-list/status-list.component.html index 81824da5e..698342b0b 100644 --- a/src/app/status-list/status-list.component.html +++ b/src/app/status-list/status-list.component.html @@ -1,3 +1,3 @@ - - - \ No newline at end of file + + + \ No newline at end of file diff --git a/src/app/status-list/status-list.component.ts b/src/app/status-list/status-list.component.ts index b07491865..6fc011497 100644 --- a/src/app/status-list/status-list.component.ts +++ b/src/app/status-list/status-list.component.ts @@ -1,4 +1,6 @@ import { Component, OnInit } from '@angular/core'; +import { Status } from '../status'; + @Component({ selector: 'app-status-list', @@ -6,10 +8,16 @@ import { Component, OnInit } from '@angular/core'; styleUrls: ['./status-list.component.scss'] }) export class StatusListComponent implements OnInit { + public currentStatus: Status = Status.Folders; + public status = Status; constructor() { } ngOnInit(): void { } + onToggle(s: Status) { + console.log("holy moly", s); + this.currentStatus = s; + } } diff --git a/src/app/status-toggle/status-toggle.component.html b/src/app/status-toggle/status-toggle.component.html index 289bccadb..58b10e4fc 100644 --- a/src/app/status-toggle/status-toggle.component.html +++ b/src/app/status-toggle/status-toggle.component.html @@ -1,4 +1,4 @@ - - Folders - Devices + + Folders + Devices \ No newline at end of file diff --git a/src/app/status-toggle/status-toggle.component.ts b/src/app/status-toggle/status-toggle.component.ts index 781359c55..6557ad626 100644 --- a/src/app/status-toggle/status-toggle.component.ts +++ b/src/app/status-toggle/status-toggle.component.ts @@ -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(); + 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; } diff --git a/src/app/status.ts b/src/app/status.ts new file mode 100644 index 000000000..872798394 --- /dev/null +++ b/src/app/status.ts @@ -0,0 +1,4 @@ +export enum Status { + Folders = 1, + Devices, +} \ No newline at end of file