You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 29, 2019. It is now read-only.
Hello team,
Currently i'm developing a large web app with angular+your awesome bootstrap ui.
When it goes to performance, angular offers many pitfalls.
I recently changed all my ng-show/hides to ng-if resulting in 20% performance boost (measured with AngularJS Batarang chrome extension and chrome web dev profiler)
The reason is the ng-show does hide the DOM elements via css. This means all watchers will continue working on the hidden elements.
That's an unnecessary enlargement of the scope digest and costs like >100ms of every scope digest (depending on hidden content and watchers there). All directives, filters, ... will still just refresh for noone.
ng-if on the other hand, removes the dom elements completely and stops the corresponding watchers from working until the dom is visible.
When the DOM element get visible again, angular does recompile the element and element'
s children so you won't even see an difference between ng-show or ng-if.