src/services/loadable-manager.js
function(src) {
    var loadable;

    // Valid state name required
    if(!src || src === '') {
      var error;
      error = new Error('Loadable requires a valid source.');
      error.code = 'invalidname';
      throw error;
    }

    // Already exists
    if(_loadableHash[src]) {
      loadable = _loadableHash[src];

    // Create new
    } else {
      // Create new instance
      loadable = new _Loadable(src);
      _loadableHash[src] = loadable;

      // Broadcast creation, progress
      $rootScope.$broadcast('$loadableCreated', loadable);
      $rootScope.$broadcast('$loadableProgress', _getProgress());

      // Completion
      loadable.promise.then(function() {

        // Broadcast complete
        $rootScope.$broadcast('$loadableProgress', _getProgress());
        if(_loadingList.length === 0) {
          $rootScope.$broadcast('$loadableComplete', loadable);
        }
      });
    }

    return loadable;
  }
function(src) {
    var loadable;

    // Valid state name required
    if(!src || src === '') {
      var error;
      error = new Error('Loadable requires a valid source.');
      error.code = 'invalidname';
      throw error;
    }

    // Already exists
    if(_loadableHash[src]) {
      loadable = _loadableHash[src];

    // Create new
    } else {
      // Create new instance
      loadable = new _Loadable(src);
      _loadableHash[src] = loadable;

      // Broadcast creation, progress
      $rootScope.$broadcast('$loadableCreated', loadable);
      $rootScope.$broadcast('$loadableProgress', _getProgress());

      // Completion
      loadable.promise.then(function() {

        // Broadcast complete
        $rootScope.$broadcast('$loadableProgress', _getProgress());
        if(_loadingList.length === 0) {
          $rootScope.$broadcast('$loadableComplete', loadable);
        }
      });
    }

    return loadable;
  }
function ( src ) { var loadable ; // Valid state name required if ( ! src || src === '' ) { var error ; error = new Error ( 'Loadable requires a valid source.' ) ; error . code = 'invalidname' ; throw error ; } // Already exists if ( _loadableHash [ src ] ) { loadable = _loadableHash [ src ] ; // Create new } else { // Create new instance loadable = new _Loadable ( src ) ; _loadableHash [ src ] = loadable ; // Broadcast creation, progress $rootScope . $broadcast ( '$loadableCreated' , loadable ) ; $rootScope . $broadcast ( '$loadableProgress' , _getProgress ( ) ) ; // Completion loadable . promise . then ( function ( ) { // Broadcast complete $rootScope . $broadcast ( '$loadableProgress' , _getProgress ( ) ) ; if ( _loadingList . length === 0 ) { $rootScope . $broadcast ( '$loadableComplete' , loadable ) ; } } ) ; } return loadable ; }
Create a _Loadable.  Does not replace previously created instances.

@param  {String}    src A source path for script asset
@return {_Loadable}     A loadable instance
Create a _Loadable . Does not replace previously created instances .