lib/di.js
function injectableWrapper(obj, provide, injects, isTransientScope) {
    // TODO(@davequick): discuss with @halfspiral whether isTransientScope might just better
    // be an array of Annotations
    var wrappedObject = function wrapOrCreateObject() {
      if(isFunction(obj) && (exists(obj.$provide) || exists(obj.$inject) || provide || injects)){
        var instance = Object.create(obj.prototype);
        return obj.apply(instance,arguments) || instance;
      }
      return obj;
    };
    return _wrapper(obj, wrappedObject, provide, injects, isTransientScope);
  }
function injectableWrapper(obj, provide, injects, isTransientScope) {
    // TODO(@davequick): discuss with @halfspiral whether isTransientScope might just better
    // be an array of Annotations
    var wrappedObject = function wrapOrCreateObject() {
      if(isFunction(obj) && (exists(obj.$provide) || exists(obj.$inject) || provide || injects)){
        var instance = Object.create(obj.prototype);
        return obj.apply(instance,arguments) || instance;
      }
      return obj;
    };
    return _wrapper(obj, wrappedObject, provide, injects, isTransientScope);
  }
function injectableWrapper ( obj , provide , injects , isTransientScope ) { // TODO(@davequick): discuss with @halfspiral whether isTransientScope might just better // be an array of Annotations var wrappedObject = function wrapOrCreateObject ( ) { if ( isFunction ( obj ) && ( exists ( obj . $provide ) || exists ( obj . $inject ) || provide || injects ) ) { var instance = Object . create ( obj . prototype ) ; return obj . apply ( instance , arguments ) || instance ; } return obj ; } ; return _wrapper ( obj , wrappedObject , provide , injects , isTransientScope ) ; }
This is meant to be used where you have an injectable that might be an injectable function.
if it is we want to actually have the injection happen while it is being returned.
@param obj
@param provide
@param injects
@param isTransientScope
@returns {*}
This is meant to be used where you have an injectable that might be an injectable function . if it is we want to actually have the injection happen while it is being returned .