frontend-tutorial-framework/src/app/sidebar/sidebar.component.ts

21 lines
609 B
TypeScript

import { Component, Input, Output, EventEmitter } from '@angular/core';
import { DashboardConfigService } from '../services/config.service';
@Component({
selector: 'app-sidebar',
templateUrl: './sidebar.component.html',
styleUrls: ['./sidebar.component.scss']
})
export class SidebarComponent {
@Input() layout: string;
@Output() layoutChanged = new EventEmitter<string>();
enabledLayouts = this.configService.enabledLayouts;
constructor(private configService: DashboardConfigService) {}
setLayout(layout: string) {
this.layout = layout;
this.layoutChanged.emit(this.layout);
}
}