Hacker News new | ask | show | jobs
by kurtfunai 4602 days ago
Thanks for the post - I regularly use a lot of these, and I'm a big fan of ng-bind attribute over the <div>{{ thing }}</div> approach.

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!

2 comments

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.
It also creates an additional scope whereas the ng:show does not.
Not that I can really take much credit but you're welcome :)