Segue os códigos. Apesar de esconder o menu, ele não volta a abrir com a função "click" no nav-burger
menu.component:
section class="hero outer is-primary is-fullheight animated slideInLeft" [ngClass]="{'is-hidden' : !menu.opened}">
menu.service.ts:
@Injectable()
export class MenuService {
opened: boolean;
constructor() { }
open (){
this.opened = true;
}
}
header.component.ts:
@Component({
providers: [MenuService],
selector: 'app-header',
templateUrl: './header.component.html',
styleUrls: ['./header.component.sass']
})
export class HeaderComponent implements OnInit {
constructor(public menu:MenuService) {
header html:
<div class="navbar-burger burger" (click)="menu.open()">
<span></span>
<span></span>
<span></span>
</div>