code: function(callbacks) {
          callbacks = callbacks || {};
          var onTrue = callbacks.onTrue || angular.noop;
          var onFalse = callbacks.onFalse || angular.noop;
          var onString = callbacks.onString || angular.noop;
          var onWait = callbacks.onWait || angular.noop;
  
          var self = this;
  
          if (this.promises.length) {
            onWait(true);
            $q.all(this.promises).then(
              //all resolved       
              function(results) {
                onWait(false);
                //check all results via same `when` method (without checking promises)
                angular.forEach(results, function(result) {
                  self.when(result, true);  
                });
                applyCallback();
              },
              //some rejected
              function(error) { 
                onWait(false);
                onString();
              }
              );
          } else {
            applyCallback();
          }
  
          function applyCallback() {
            if (!self.hasString && !self.hasFalse) {
              onTrue();
            } else if (!self.hasString && self.hasFalse) {
              onFalse();
            } else {
              onString();
            }
          }
  
        }
docs: callbacks: onTrue, onFalse, onString