Added codemirror ngModel to cancel properly

ngModel will not reverted to its original state if cancelled.