import { Component, ViewChild, AfterViewInit } from '@angular/core'; import { NgbOffcanvas } from '@ng-bootstrap/ng-bootstrap'; import { OffcanvasComponent } from './offcanvas/offcanvas.component'; @Component({ selector: 'app-journal-home', templateUrl: './journal-home.component.html', styleUrls: ['./journal-home.component.scss'], }) export class JournalHomeComponent { @ViewChild('offcanvas') offcanvasNavigation?: OffcanvasComponent; public openNavigation(): void { this.offcanvasNavigation?.openNavigation(); } // public ngAfterViewInit(): void { // // Hier können funktionen aufgerufen werden, die in der child component definiert sind // this.offcanvasNavigation?.openNavigation(); // } }