Added theme switching
All checks were successful
Copy Files to Samba Share dev / Copy Files (push) Successful in 22s
All checks were successful
Copy Files to Samba Share dev / Copy Files (push) Successful in 22s
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Component, computed, input, output } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-hero',
|
||||
@@ -8,5 +8,13 @@ import { Component } from '@angular/core';
|
||||
styleUrl: './hero.component.scss'
|
||||
})
|
||||
export class HeroComponent {
|
||||
theme= input<string>();
|
||||
isDarkMode = computed(() => {
|
||||
return this.theme() === 'dark';
|
||||
});
|
||||
themeChange = output<string>();
|
||||
|
||||
public themeClicked(event: any) {
|
||||
this.themeChange.emit(event.target.checked ? 'dark' : 'light');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user