[Admin | Trunk]: Community edit form: Add function for valid email
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-admin-portal/trunk@59226 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
4cf0211995
commit
5731b3c952
|
@ -56,7 +56,7 @@
|
|||
<td class="uk-text-left">
|
||||
<div *ngIf="community.managers != null">
|
||||
<div *ngFor='let manager of community.managers, let i = index; trackBy:trackByFn'>
|
||||
<div *ngIf="!community.managers[i].match('^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$') && community.managers[i] != '' "
|
||||
<div *ngIf="!validEmail(community.managers[i]) && community.managers[i] != '' "
|
||||
class="uk-width-large uk-text-danger uk-text-small uk-margin-top"> Please add a valid email. </div>
|
||||
<input placeholder="Type managers" type="text" class="form-control uk-input uk-width-large@l uk-width-medium@s"
|
||||
id="{{'manager'+i}}" name="{{'manager'+i}}" [(ngModel)] = "community.managers[i]" (input)="change()">
|
||||
|
|
|
@ -144,6 +144,10 @@ export class CommunityEditFormComponent implements OnInit{
|
|||
}
|
||||
}
|
||||
|
||||
public validEmail(email: string): boolean {
|
||||
return Validator.emailValidator(email);
|
||||
}
|
||||
|
||||
public updateCommunity() {
|
||||
if (!Session.isLoggedIn()) {
|
||||
this._router.navigate(['/user-info'], { queryParams:
|
||||
|
|
Loading…
Reference in New Issue