function defer() {
    return new Deferred();
  }
@ngdoc method
@name ng.$q#defer
@kind function

@description
Creates a `Deferred` object which represents a task which will finish in the future.

@returns {Deferred} Returns a new instance of deferred.