title: Create empty promise in angular?
body: <p>I want to do something like this:</p>
  
  <pre><code>var promise = IAmAEmptyPromise;
  
  if(condition){
      promise = ApiService.getRealPromise();
  }
  
  promise.then(function(){
      //do something
  });
  </code></pre>
  
  <p>So I want to declare a promise, which can be resolved using then. However this promise may be overwritten by another promise, which returns content. Later I want to resolve the promise whether it has content or not. Is this possible? I tried with:</p>
  
  <pre><code>var promise = $q.defer().promise;
  
  if(!$scope.user){
      promise = UserService.create(params);
  }
  
  promise.then(function(){
     //either user was created or the user already exists.
  });
  </code></pre>
  
  <p>However this does not work when a user is present. Any ideas?</p>