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.

alternative ng-show/-hide or how load relevant section of dom what difference between ng-if , ng-show/ng-hide when favor ng-if vs. ng-show/ng-hide?

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

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -