normally everything works fine for me, when I run ng build
my code keeps working fine, and the event is triggered (activate)
. But when executing ng build --prod
this event does not run. Why can this happen to me and how can I correct it?
Thank you
this code is my app.ts and .html
<menu class="m-0 p-0" *ngIf="hide"></menu>
<router-outlet class="m-0 p-0" (activate)='onActivate($event)' ></router-outlet>
<footer_component *ngIf="hide"></footer_component>
onActivate(component:any){
this.activatedComponent = component.constructor.name;
before compiling with ng build works, after running ng build it also works, but with ng build --prod no, it seems that it does not enter the function.
console.log(activatedComponent);
if(this.activatedComponent != 'LoginComponent' && this.activatedComponent != 'RestorePasswordComponent' && this.activatedComponent != 'NotFoundComponent'){
this.hide = true;
} else
{
this.hide = false;
}
}