angularjs - what is the difference between ngSwitch and ngInclude? -
what difference between ngswitch , nginclude?
i need understand difference, can continue on project.
does ngswitch hides dom elements?
you may find v1.1.4 documentation more helpful (just ignore stuff animations if not using 1.1.4): ngswitch
ngswitch conditionally adds/removes dom elements (ng-show/hide alters css).
nginclude can fetch partials/external html fragments.
both create new child scopes prototypically inherit parent scopes. (a new child scope created each ng-switch-when/default.)
you can use nginclude ngswitch: https://stackoverflow.com/a/12584774/215945
use nginclude when want (or can) reuse html fragments, such client ui (https://stackoverflow.com/a/13005658/215945).
Comments
Post a Comment