Having trouble calling a function within a service, as I keep getting the error message
Cannot read property 'authenticationService' of undefined
I have already initialized authenticationService
in the constructor of my component.
The component code is shown below:
export class RegisterComponent implements OnInit {
// Component properties and methods here
}
The service code is displayed below:
@Injectable()
export class AuthenticationService {
// Service properties and methods here
}
Everything seems to work fine with the call to authenticationService
in register()
method. However, the checkEmailUnique
method should be making a POST request to the backend to verify if an email already exists and return true or false.