diff --git a/src/components/create-edit-modal/create-edit-modal.component.ts b/src/components/create-edit-modal/create-edit-modal.component.ts index 87bec2c..b00c501 100644 --- a/src/components/create-edit-modal/create-edit-modal.component.ts +++ b/src/components/create-edit-modal/create-edit-modal.component.ts @@ -55,7 +55,8 @@ export class CreateEditModalComponent { } protected addImageControl() { - this.images.push(new FormControl("")) + const urlRegex: string = '(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/?' + this.images.push(new FormControl("", [Validators.required, Validators.pattern(urlRegex)])) } protected removeImageControl(index: number) {