If ng-show happens to be too slow without an obvious reason

It happened to me tonight that ng-show was taking too long to refresh. I’ve read about the differences between ng-if and ng-show and how sometimes ng-show can decrease performance. But in this case it was a pretty straightforward example, and it shouldn’t.

In the end it turned out to be the combination of ng-show and ng-animate. I wasn’t using any animation, but there was a css transition running anyway, and making things look slower than they were.

If any of this ever happens to you, and you don’t want to remove ng-animate from your project, simply add the .no-animate class to the element where ng-show or ng-hide is used, and update your css with the following lines.

.ng-animate.no-animate {
  transition: 0s none;
  -webkit-transition: 0s none;
  animation: 0s none;
  -webkit-animation: 0s none;
}

As simple as that.