Dynamic class change is depreciated?

on ngOnInit, I changed boolean value to true
and home. html


 <p [ngClass]="showNext ? 'dragging_mention':'show_mention'">{{mention_detail}}aaaa</p>

I changed showNext value to true after 5seconds.
I think class should be changed to dragging_mention because showNext value is changed to true
but never changed. it remain show_mention
how can I change view by changing showNext value?

public showNext :boolean =false;
ngOnInit(){
  setTimeout(()=>{
    this.showNext=true;
    alert("ss"+this.showNext);
  },5000)
}

What you have posted works, so the problem is elsewhere. Are you certain there are no errors elsewhere in the controller causing change detection to crash?