import { Component, OnInit, Input, ViewChild } from '@angular/core'; @Component({ selector: 'x-sidebar', templateUrl: './sidebar.component.html', styleUrls: ['./sidebar.component.scss'] }) export class SidebarComponent implements OnInit { @Input() isOpen: boolean; @Input() headerTitle = ''; @Input() isHeaderRequired = false; @Input() top: number; @Input() isCloseButtonRequired: boolean; @Input() isLightTheme: boolean; @Input() backColor: string; constructor() { } ngOnInit() { if (this.isCloseButtonRequired === undefined) { this.isCloseButtonRequired = true; } if (this.isLightTheme === undefined) { this.isLightTheme = false; } if (this.backColor === undefined) { this.backColor = ''; } if(this.top === undefined){ this.top = 40; } } toggleSidebar() { this.isOpen = !this.isOpen; } }