I created a sidebar menu, but I am not able to hide the menu after I click on a menu item. I followed the example from https://blog.thecodecampus.de/angular-2-animate-creating-s
You have to do the toggle things in NgZone. And for that first you have to add following module.
import { NgZone } from '@angular/core';
Now create zone variable in constructor
constructor(public zone: NgZone){}
and write your toggle logic in Zone()
method like following way
toggleMenu() {
this.zone.run(()=>{
this.menuState = this.menuState === 'out' ? 'in' : 'out';
})
}