import { Component, OnInit } from '@angular/core'; import { rootDefaultService } from '../service/root.service'; @Component({ selector: 'app-toolbar', templateUrl: './toolbar.component.html', styleUrls: ['./toolbar.component.css'] }) export class ToolbarComponent implements OnInit { themes = [{ show: "Dark Theme", name: 'unicorn-dark-theme', }, { show: "Light Theme", name: 'unicorn-light-theme' }, { show: "Swica theme", name: "unicorn-swica-theme" }] selectedTheme:any; constructor(private rootDefaultService: rootDefaultService) { } ngOnInit() { this.selectedTheme = this.rootDefaultService.getTheme(); } toggleSideNav(){ this.rootDefaultService.toggleSideNav(); } OnChangeTheme(ev){ this.rootDefaultService.changeTheme(this.selectedTheme); } }