Components/create-edit-modal: add validation to image controls
This commit is contained in:
parent
b2cfda8c32
commit
f839706d05
1 changed files with 2 additions and 1 deletions
|
|
@ -55,7 +55,8 @@ export class CreateEditModalComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected addImageControl() {
|
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) {
|
protected removeImageControl(index: number) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue