Giter Site home page Giter Site logo

bam-filtering's Introduction

BAM Filters

  • A growing list of angular filters that are dynamic enough to support nested Json data structures.
  • Compatible with Angular v1.2.2+

Getting Started

  1. Currently you will need to download the zip from GitHub, and drop it into your project where desired.

  2. Include bam-filtering.js (or bam-filtering.min.js) in your index.html, after including Angular itself.

  3. Add 'bam.filtering' to your main module's list of dependencies.

Basic Usage

  • You are able to access nested attributes by passing an of keys into the filter like so:

      #json: 
      [{"Key1": {"Key2": {"Key3": 1}}}, {"Key1": {"Key2": {"Key3": 2}}}]
    
      <div ng-repeat="item in items | bamGreaterThan: ['Key1', 'Key1', 'Key3']: 1">
      </div>
    
      returned value: 
      {"Key1": {"Key2": {"Key3": 2}}}
    
  • If a json object does not contain the requested key, then it is filtered out, like so:

      #json: 
      # Notice the second object does not contain Key3
      [{"Key1": {"Key2": {"Key3": 1}}}, {"Key1": {"Key2": {}}}]
    
      <div ng-repeat="item in items | bamGreaterThan: ['Key1', 'Key1', 'Key3']: 0">
      </div>
    
      returned value: 
      {"Key1": {"Key2": {"Key3": 1}}}
    
  • If you do not want to filter my nested keys, pass in an empty array:

      #data: 
      [1, 2, 3]
    
      <div ng-repeat="item in items | bamGreaterThan: []: 0">
      </div>
    
      returned value: 
      [1, 2, 3]
    

Filters

Numberic Filters:

  • Filters by a number value, supports interger or floats.
    • bamGreaterThan
    • bamLessThan

Word Counting filters:

  • Filter by the number of words in a string (seperated at a space). Filters by an integer.
    • bamWordCountGreaterThan
    • bamWordCountLessThan

About

  • Pull request, additions, and issues are welcome.
  • Released under M.I.T.
  • Brought to you by Blast Analytics and Marketing Blast A.M.

bam-filtering's People

Contributors

naysayer avatar

Watchers

Lee Benke avatar Joe Christopher avatar James Cloos avatar Olaf Calderon avatar  avatar  avatar Hoff avatar ChrisH avatar  avatar  avatar Paul Lear avatar Nik Earnest avatar Eduard Boguslavsky avatar Joe Allen-Black avatar  avatar  avatar Nick Mannon avatar TJ Webster avatar  avatar Jack avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.