If the court has power to grant an injunction or an order for specific performance, the court may give damages in addition to, or in substitution for, the injunction or specific performance.