code: function(url) {
          var data = _urlDictionary.lookup(url);
  
          if(data) {
            var state = data.ref;
  
            if(state) {
              // Parse params from url
              return _changeStateAndBroadcastComplete(state.name, data.params);
            }
          } else if(!!url && url !== '') {
            var error = new Error('Requested state was not defined.');
            error.code = 'notfound';
            $rootScope.$broadcast('$stateChangeErrorNotFound', error, {
              url: url
            });
          }
  
          return $q.reject(new Error('Unable to find location in library'));
        }
docs: Internal method to change state based on $location.url(), asynchronous operation using internal methods, quiet fallback.
  
  @param  {String}      url        A url matching defind states
  @param  {Function}    [callback] A callback, function(err)
  @return {$state}                 Itself; chainable