t $scope.promise with a new promise
  $scope.successPromise = $q.defer();

  // React to promise in controller
  $scope.successPromise
    .promise
    .then(function(){
      console.log('Done from controller');
    });

  // Set a timeout for 3 seconds and resolve
  $timeout(function(){
    $scope.successPromise.resolve('Done!');
  }, 3000);
};
                  </pre>
                </div>
              </div>
            </div>
            <!-- /- end code samle -->

            <br>

            <!-- 