664 . The court shall in all cases, except when it appears that the object of granting the injunction would be defeated by the delay, before granting an injunction cause the petition of application for the same together with the accompanying affidavit to be served on the opposite party; and where the application is made after the defendant has answered, the injunction shall in no case be granted before such service. But the court may in its discretion enjoin the defendant until the hearing and decision of the application. *Application to be on notice to opposite party.*