I joined a new Angular project and on the app.component.ts are some @HostBindings that are called non-stop even though there is no direct event that is triggered. Ex.:
settings = {
layout: { isCollapsed: false }
}
@HostBinding('class.aside-collapsed') get isCollapsed() {
return this.settings.layout.isCollapsed;
};
The layout object is part of SettingsService and the property is only changed when the side-menu is toggled: header.component.ts:
toggleMobileMenu(event: any) {
event.preventDefault();
this.settings.layout.isCollapsed = !this.settings.layout.isCollapsed;
}
A non-angular hack using mutation observer,