Landingpage Grid-layout erstellt, Navbar implementiert, SEO vorbereitet
This commit is contained in:
20
src/app/shared/utils/toogle-theme/toogle-theme.component.ts
Normal file
20
src/app/shared/utils/toogle-theme/toogle-theme.component.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Component, inject } from '@angular/core';
|
||||
import { ThemeService } from '@core/services/theme.service';
|
||||
import { NgIcon, provideIcons } from '@ng-icons/core';
|
||||
import { cssMoon, cssSun } from '@ng-icons/css.gg';
|
||||
|
||||
@Component({
|
||||
selector: 'app-toogle-theme',
|
||||
imports: [NgIcon],
|
||||
templateUrl: './toogle-theme.component.html',
|
||||
styleUrl: './toogle-theme.component.scss',
|
||||
viewProviders: [provideIcons({cssMoon, cssSun})]
|
||||
})
|
||||
export class ToogleThemeComponent {
|
||||
themeService = inject(ThemeService);
|
||||
toggleTheme() {
|
||||
const current = this.themeService.theme();
|
||||
const next = current === 'light' ? 'dark' : 'light';
|
||||
this.themeService.setTheme(next);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user