Malik Kashmiri Malik Kashmiri - 1 month ago 5x
TypeScript Question

TypeError: onEmailBlur is not a function

I am trying to call a function on blur but it show this error

TypeError: self._el_21.onEmailBlur is not a function
. I have no Idea why it showing this because I use some question but it perfectly working fine.


<input type="email" required [(ngModel)]=''


import { Component, Inject } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms';
import { UserService} from '../../services/user.service';
import { OnInit} from '@angular/core';
selector: 'invite-user',
templateUrl: '../../app/components/user/invite-user.html',
providers: [UserService, HttpHelper, NotificationsService],
directives: [MODAL_DIRECTIVES, SimpleNotificationsComponent]

export class InviteUserComponent {
// InviteUserForm: FormGroup;

isValidForm: Boolean = false;

ngOnInit() {

public onEmailBlur() {


Your code works for me. Maybe you made the same mistake I did when trying to implement your code a few minutes ago - I didn't start my compiler, so onEmailBlur() from .ts file wasn't compiled to .js, resulting in onEmailBlur is not a function error.