javascript - Many instances of ngIf vs ngShow for complex UI and forms -
javascript - Many instances of ngIf vs ngShow for complex UI and forms -
i found few questions regarding ngshow vs ngif nil addressed utilize case well.
i understand differences between 2 directives application many conditional ui elements (content, toolbar buttons, dropdowns, form fields, etc - of in ngrepeats) improve selection - ngshow or ngif? user navigates application , loads different content ui, these conditions evaluated happen regularly opposed 1 time might user preferences or permissions. also, much of content conditionally displayed contains {{bindings}}. number of watches concern ngshow while big number of dom manipulations concerns me ngif.
is there best practice or guidance type of situation? there threshold 1 makes sense on other? or matter of trying both determine performance impacts of each (easier said done)?
always utilize ng-if if possible. content not in dom must not watched etc. if have bindings. hence performs better. utilize ng-show if
you have complicated event handlers on dom elements can hidden the hide/show value changes extremely (dom manipulation expensive) javascript angularjs
Comments
Post a Comment