model.js
function(attrs, attr) {
    if (!_.isString(attr)) {
      return undefined;
    }

    var keys = attr.split('.');
    var key;
    var val = attrs;
    var context = this;

    for (var i = 0, n = keys.length; i < n; i++) {
      // get key
      key = keys[i];

      // Hold reference to the context when diving deep into nested keys
      if (i > 0) {
        context = val;
      }

      // get value for key
      val = val[key];

      // value for key does not exist
      // break out of loop early
      if (_.isUndefined(val) || _.isNull(val)) {
        break;
      }
    }

    // Eval computed properties that are functions
    if (_.isFunction(val)) {
      // Call it with the proper context (see above)
      val = val.call(context);
    }

    return val;
  }
function(attrs, attr) {
    if (!_.isString(attr)) {
      return undefined;
    }

    var keys = attr.split('.');
    var key;
    var val = attrs;
    var context = this;

    for (var i = 0, n = keys.length; i < n; i++) {
      // get key
      key = keys[i];

      // Hold reference to the context when diving deep into nested keys
      if (i > 0) {
        context = val;
      }

      // get value for key
      val = val[key];

      // value for key does not exist
      // break out of loop early
      if (_.isUndefined(val) || _.isNull(val)) {
        break;
      }
    }

    // Eval computed properties that are functions
    if (_.isFunction(val)) {
      // Call it with the proper context (see above)
      val = val.call(context);
    }

    return val;
  }
function ( attrs , attr ) { if ( ! _ . isString ( attr ) ) { return undefined ; } var keys = attr . split ( '.' ) ; var key ; var val = attrs ; var context = this ; for ( var i = 0 , n = keys . length ; i < n ; i ++ ) { // get key key = keys [ i ] ; // Hold reference to the context when diving deep into nested keys if ( i > 0 ) { context = val ; } // get value for key val = val [ key ] ; // value for key does not exist // break out of loop early if ( _ . isUndefined ( val ) || _ . isNull ( val ) ) { break ; } } // Eval computed properties that are functions if ( _ . isFunction ( val ) ) { // Call it with the proper context (see above) val = val . call ( context ) ; } return val ; }
DEPRECATED 2015-05-08 Soon `get` will use lodash `get` instead of `getDeep`
DEPRECATED 2015 - 05 - 08 Soon get will use lodash get instead of getDeep