Re:Little-known directives of Angular.js
by mmorris on Wednesday November 06, 2013 @02:34PM
(#6684902)
Just to be clear (and as mentioned in a comment on the post), ng-switch is actually closer in functionality to using multiple ng-if directives (which is only in Angular 1.1.5+). ng-switch actually adds/removes the elements from the DOM, whereas ng-show just shows/hides the element.
Re:Little-known directives of Angular.js
by sheerun on Wednesday November 06, 2013 @01:45PM
(#6684528)
I like your description. Indeed one of the best things about ui-view is that states can be inherited.
Say you want to load search.results.details, and it will render search page first, then results inside, then details.
Also, in sub-states you can use templates defined in parent-state template. It means you don't need to render cache templates all at once. Just for sub-states.
Things that really caught my eye:
- ng-list: sounds very useful for user forms, tagging, etc
- ng-switch: I dont know how many times I've used ng-show to replicate this functionality. Thank you!
a simplified description is that its a router for multiple-panes. where different related states can make use of inheritance.
http://txt.fliglio.com/2013/05/angularjs-state-management-wi...
http://jsfiddle.net/benschwartz/LhydD/
Say you want to load search.results.details, and it will render search page first, then results inside, then details.
Also, in sub-states you can use templates defined in parent-state template. It means you don't need to render cache templates all at once. Just for sub-states.
I'm confused. What does angular have to do with this?
So try not to get attached.
Does it work in filters?
{{ user }}
instead of the content that should really be shown in place of it.