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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -