function Walker (data, propExpression) {
            var self = this;
            /**
             * The current key in an expression to evaluate
             */
            var targetKey = null;

            /**
             * The keys in a property expression that must be processed
             */
            var targetProps = null;

            /**
             * Determines which object is a primitive type
             */
            var isPrimitive = true;

            /**
             * Flag to indicate whether to retrieve a value from an array using its number
             * based index or an objects key within an array
             */
            var useIndex = false;
            
            self.walk = function (func) {
                find(data, targetProps, func);
            };

            /**
             * Recursively walks an object to reach the property expression.
             *
             * Continuing from our example in the parseKeys() method below, assume we start with the following 
             * expression:
             *
             * <code> 
             * 'd.name in pets.dogs'</br>
             * targetKey => 'name'</br>
             * targetProps => ['pets', 'dogs']</br>
             * </br>
             *
             * This method will evaluate each property in the targetProps array against the current obj (on first iteration)
             * or against the preceding expression evaluation until all have been processed. 
             * 
             * Once at the end, 
             * we evalute the targetKey against the last targetProp. So in this case, we would end up evaluation the 
             * `name` property in an object within a dogs array.
             * </code>
             *
             * @public
             * @memberof Services.Walker
             * @param {object} obj
             * Object to traverse
             * @param {props} props
             * Array of split property expressions.              
             */

            function find (obj, props, q) {
                props = angular.copy(props);

                if (!props) {
                    return q.call(self, $parse(targetKey)(obj));
                }

                if (props.length === 0) {
                    if (isPrimitive || useIndex) {
                        //return match(obj, q);
                        return q.call(self, obj);
                    } 
                    return q.call(self, $parse(targetKey)(obj));
                }

                var curProp = props.shift();
                var value = $parse(curProp)(obj);
                if (angular.isArray(value)) {
                    for (var x = 0; x < value.length; x++) {
                        var found = find(value[x], props, q);
                        if (found) {
                            return;
                        }
                    }
                }
            }

            /**
             * Parses the property expression to determine the following:
             * @private
             * @memberof Services.Walker
             *
             * - if an array must be traversed
             * - if the expression is searching a primitive value
             * - if an array is being traversed, then should we pull from the array index (e.g. obj[0])
             *   or pull from an object within an array (e.g. obj.name)
             *
             * @example
             *
             * Given the following property expression
             *
             * 'd in dogs'
             *
             * This will be processed by the ARRAY_FILTER_REGEX. Since this contains `in`, an array is being traversed.
             * This will be split into a targetKey and targetProps. The targetKey in this case will be `d` and the targetProps
             * will contain an array split on the "." character to yield ['dogs']. Since only `d` was specified, we're only
             * targeting the index of the array.
             *
             * targetKey => 'd'
             * targetProps => ['dogs']
             *
             * However, given this expression
             *
             * 'd.name in pets.dogs'
             *
             * This would result in the following when constructed
             *
             * targetKey => 'name'
             * targetProps => ['pets', 'dogs']
             *
             */
            function parseKeys () {
                var m = propExpression.match(ARRAY_FILTER_REGEX);
                if (m) {
                    targetKey = m[1].split('.').splice(1).join('.');
                    targetProps = m[2].split('.');
                    isPrimitive = false;
                    useIndex = (targetKey === '');
                } else {
                    targetKey = propExpression;
                }
            }

            parseKeys();
        }
/**
         * Traverses an object based on the property expression. Given a property expression, this will
         * recursively evaluate each property within the expression until all properties have been evaluated.
         *
         *
         * @constructor
         * @memberof Services
         * @param {object} data 
         * Object being traversed
         * @param {string} propExpression
         * A string containing a property expression to evaluate
         */
Traverses an object based on the property expression. Given a property expression, this will
recursively evaluate each property within the expression until all properties have been evaluated.

@constructor
@memberof Services
@param {object} data
Object being traversed
@param {string} propExpression
A string containing a property expression to evaluate
Traverses an object based on the property expression . Given a property expression this will recursively evaluate each property within the expression until all properties have been evaluated . @constructor @memberof Services @param { object } data Object being traversed @param { string } propExpression A string containing a property expression to evaluate
function Walker (data, propExpression) {
            var self = this;
            var targetKey = null;
            var targetProps = null;
            var isPrimitive = true;
            var useIndex = false;
            self.walk = function (func) {
                find(data, targetProps, func);
            };
            function find (obj, props, q) {
                props = angular.copy(props);
                if (!props) {
                    return q.call(self, $parse(targetKey)(obj));
                }
                if (props.length === 0) {
                    if (isPrimitive || useIndex) {
                        return q.call(self, obj);
                    } 
                    return q.call(self, $parse(targetKey)(obj));
                }
                var curProp = props.shift();
                var value = $parse(curProp)(obj);
                if (angular.isArray(value)) {
                    for (var x = 0; x < value.length; x++) {
                        var found = find(value[x], props, q);
                        if (found) {
                            return;
                        }
                    }
                }
            }
            function parseKeys () {
                var m = propExpression.match(ARRAY_FILTER_REGEX);
                if (m) {
                    targetKey = m[1].split('.').splice(1).join('.');
                    targetProps = m[2].split('.');
                    isPrimitive = false;
                    useIndex = (targetKey === '');
                } else {
                    targetKey = propExpression;
                }
            }
            parseKeys();
        }
function Walker ( data , propExpression ) { var self = this ; var targetKey = null ; var targetProps = null ; var isPrimitive = true ; var useIndex = false ; self . walk = function ( func ) { find ( data , targetProps , func ) ; } ; function find ( obj , props , q ) { props = angular . copy ( props ) ; if ( ! props ) { return q . call ( self , $parse ( targetKey ) ( obj ) ) ; } if ( props . length === 0 ) { if ( isPrimitive || useIndex ) { return q . call ( self , obj ) ; } return q . call ( self , $parse ( targetKey ) ( obj ) ) ; } var curProp = props . shift ( ) ; var value = $parse ( curProp ) ( obj ) ; if ( angular . isArray ( value ) ) { for ( var x = 0 ; x < value . length ; x ++ ) { var found = find ( value [ x ] , props , q ) ; if ( found ) { return ; } } } } function parseKeys ( ) { var m = propExpression . match ( ARRAY_FILTER_REGEX ) ; if ( m ) { targetKey = m [ 1 ] . split ( '.' ) . splice ( 1 ) . join ( '.' ) ; targetProps = m [ 2 ] . split ( '.' ) ; isPrimitive = false ; useIndex = ( targetKey === '' ) ; } else { targetKey = propExpression ; } } parseKeys ( ) ; }
Traverses an object based on the property expression.
Traverses an object based on the property expression .
/**
             * The current key in an expression to evaluate
             */ /**
             * The keys in a property expression that must be processed
             */ /**
             * Determines which object is a primitive type
             */ /**
             * Flag to indicate whether to retrieve a value from an array using its number
             * based index or an objects key within an array
             */ /**
             * Recursively walks an object to reach the property expression.
             *
             * Continuing from our example in the parseKeys() method below, assume we start with the following 
             * expression:
             *
             * <code> 
             * 'd.name in pets.dogs'</br>
             * targetKey => 'name'</br>
             * targetProps => ['pets', 'dogs']</br>
             * </br>
             *
             * This method will evaluate each property in the targetProps array against the current obj (on first iteration)
             * or against the preceding expression evaluation until all have been processed. 
             * 
             * Once at the end, 
             * we evalute the targetKey against the last targetProp. So in this case, we would end up evaluation the 
             * `name` property in an object within a dogs array.
             * </code>
             *
             * @public
             * @memberof Services.Walker
             * @param {object} obj
             * Object to traverse
             * @param {props} props
             * Array of split property expressions.              
             */ //return match(obj, q); /**
             * Parses the property expression to determine the following:
             * @private
             * @memberof Services.Walker
             *
             * - if an array must be traversed
             * - if the expression is searching a primitive value
             * - if an array is being traversed, then should we pull from the array index (e.g. obj[0])
             *   or pull from an object within an array (e.g. obj.name)
             *
             * @example
             *
             * Given the following property expression
             *
             * 'd in dogs'
             *
             * This will be processed by the ARRAY_FILTER_REGEX. Since this contains `in`, an array is being traversed.
             * This will be split into a targetKey and targetProps. The targetKey in this case will be `d` and the targetProps
             * will contain an array split on the "." character to yield ['dogs']. Since only `d` was specified, we're only
             * targeting the index of the array.
             *
             * targetKey => 'd'
             * targetProps => ['dogs']
             *
             * However, given this expression
             *
             * 'd.name in pets.dogs'
             *
             * This would result in the following when constructed
             *
             * targetKey => 'name'
             * targetProps => ['pets', 'dogs']
             *
             */