src/services/state-router.js
function(name) {
    name = name || '';

    var state = null;

    // Only use valid state queries
    if(!_validateStateName(name)) {
      return null;
    
    // Use cache if exists
    } else if(_stateCache[name]) {
      return _stateCache[name];
    }

    var nameChain = _getNameChain(name);
    var stateChain = nameChain
      .map(function(name, i) {
        var item = angular.copy(_stateLibrary[name]);
        return item;
      })
      .filter(function(parent) {
        return !!parent;
      });

    // Walk up checking inheritance
    for(var i=stateChain.length-1; i>=0; i--) {
      if(stateChain[i]) {
        var nextState = stateChain[i];
        state = angular.merge(nextState, state || {});
      }

      if(state && state.inherit === false) break;
    }

    // Store in cache
    _stateCache[name] = state;

    return state;
  }
function(name) {
    name = name || '';

    var state = null;

    // Only use valid state queries
    if(!_validateStateName(name)) {
      return null;
    
    // Use cache if exists
    } else if(_stateCache[name]) {
      return _stateCache[name];
    }

    var nameChain = _getNameChain(name);
    var stateChain = nameChain
      .map(function(name, i) {
        var item = angular.copy(_stateLibrary[name]);
        return item;
      })
      .filter(function(parent) {
        return !!parent;
      });

    // Walk up checking inheritance
    for(var i=stateChain.length-1; i>=0; i--) {
      if(stateChain[i]) {
        var nextState = stateChain[i];
        state = angular.merge(nextState, state || {});
      }

      if(state && state.inherit === false) break;
    }

    // Store in cache
    _stateCache[name] = state;

    return state;
  }
function ( name ) { name = name || '' ; var state = null ; // Only use valid state queries if ( ! _validateStateName ( name ) ) { return null ; // Use cache if exists } else if ( _stateCache [ name ] ) { return _stateCache [ name ] ; } var nameChain = _getNameChain ( name ) ; var stateChain = nameChain . map ( function ( name , i ) { var item = angular . copy ( _stateLibrary [ name ] ) ; return item ; } ) . filter ( function ( parent ) { return ! ! parent ; } ) ; // Walk up checking inheritance for ( var i = stateChain . length - 1 ; i >= 0 ; i -- ) { if ( stateChain [ i ] ) { var nextState = stateChain [ i ] ; state = angular . merge ( nextState , state || { } ) ; } if ( state && state . inherit === false ) break ; } // Store in cache _stateCache [ name ] = state ; return state ; }
Internal method to crawl library heirarchy

@param  {String} name   A unique identifier for the state; using state-notation
@return {Object}        A state data Object
Internal method to crawl library heirarchy