Skip to content

Commit

Permalink
Error that prevented clicking on Invite Users, All Students, User Adm…
Browse files Browse the repository at this point in the history
…inistration (#741)
  • Loading branch information
ctxdl authored and objectliteral committed Dec 18, 2017
1 parent 480d22f commit 1879a2e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/users/invite-users/invite-users.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h1>{{ 'invite users' | translate }}</h1>
separatorKeys="[32]"
(onRemove)="onRemove($event)"
(onAdd)="onAdd($event)"
[transform]="validateEmail"
[onAdding]="validateEmail"
[secondaryPlaceholder] ="('Enter email ids' | translate)"
[placeholder]="('+ Email')" ngDefaultControl #input>
<ng-template let-item="item">
Expand Down
6 changes: 4 additions & 2 deletions app/users/invite-users/invite-users.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Component } from '@angular/core';
import { ToasterService } from 'angular2-toaster';
import { TranslateService } from 'ng2-translate';
import { Observable } from 'rxjs/Rx';

import { UserService } from '../user.service';
import { User } from '../user.model';
Expand All @@ -22,9 +23,10 @@ export class InviteUsersComponent {
private userService: UserService,
private translateService: TranslateService) {}

public validateEmail(item: any): string {
public validateEmail(item: any): Observable<string> {
if (User.validateEmail(item)) {
return `${item}`;
return Observable
.of(item);
}
}

Expand Down

0 comments on commit 1879a2e

Please sign in to comment.