JanStevens / angular-growl-2

growl-like notifications for angularJS projects
MIT License
285 stars 97 forks source link

globalDisableCountDown: use ng-if instead of ng-hide to avoid DOM update every second #98

Closed sheymann closed 7 years ago

sheymann commented 9 years ago

Using growlProvider.globalDisableCountDown(true); the HTML markup is still inserted in the DOM:

<button type="button" class="close ng-binding ng-hide" aria-hidden="true" ng-show="showCountDown(message)">
  39
</button>

and the timer is updated every second. As a consequence the DOM is updated every second as well, which hurts performance.

flippinjoe commented 9 years ago

Definitely agree. Great find. I'll get this one in asap

flaviocysne commented 8 years ago

This is a minor change to the angular-growl-2 template. You can create your own template, similar to the default one, and change ng-show to ng-if.

I submitted a pull request to change it. Vote for it.

blitzmann commented 7 years ago

If I understand correctly, this issue has been resolved by the pull requests, correct? Can we close it?