Fun with AngularJS Filters – Paleo Edition!

I Heart Paleo

My friend Anthony posted a question the other day about how to bind two select inputs together. Using that as a starting point, I dug into a few fun things that you can do with AngularJS filters and supporting cast.

Paleo edition shout out to my bro Ben Nadel who happens to be one of my favorite bloggers. Check him out here http://www.bennadel.com/


Download YouTube Video | Convert YouTube to MP3

Code can be downloaded here https://github.com/simpulton/angularjs-filters-paleo

I hope you like it and thanks for the great question Anthony!

Fun with AngularJS Filters – Paleo Edition!

4 Responses

  1. This is really cool. I have to admit, I have definitely shied away from filters. I never really understood the syntax well and I just kind of never went at them. But, your examples really make me want to re-think that decision. The grouped-output, especially, seems super powerful! I’ll have to do some more research on filters; one thing that sticks out in my mind is simply how often the filter is applied (as far as the digest lifecycle goes). Very cool stuff!

    Also, totally unrelated, I was looking at the docs for ngModel[radio] today and someone in the comments mentioned “ngValue”. Apparently it’s undocumented, but handles booleans a bit better. Not sure if you’ve run across that at all.

    Mmmm. Bacon :)

    Ben Nadel June 20, 2013 at 1:26 am #
  2. At 5:26, had you assigned a default value for $scope.myGroup, you could have said ng-show=”myGroup != null” (or whatever the default value was), and you wouldn’t need to be on the run from the CSS police!

    Also, filters are not only for arrays :) They take an input and give an output.

    Otherwise, good presentation :)

    Arsen Kuntic June 29, 2013 at 9:51 am #
  3. As a newbie to angular, really loving your site.
    Good job and keep it up.

    Robin Thebs October 4, 2013 at 3:32 am #
  4. I’ve been learning angular, and getting the concept is probably what has been the most challenging coming from jQuery. You just helped me understand the filter and ng-class much better, thank you :)

    Lasse October 18, 2013 at 5:03 pm #

Leave a Reply