MEAN Stack Tutorial with Angular 2 - Part 5: Angular 2 HTTP Module for User Registration

preview_player
Показать описание
Source code:
Рекомендации по теме
Комментарии
Автор

Great series David.

Super minor extras:

(focus)="usernameMessage=''" (blur)="checkUsername()"
Including focus event before blur. Same with email.

Also with checkUsername() and checkEmail() adding an extra condition:

checkUsername() {
const username =
=> {

if (!data.success) {
this.usernameValid = false;
this.usernameMessage = data.message;
} else if {
this.usernameValid = true;
this.usernameMessage = data.message;
} else {
this.usernameMessage = '';
}
});
}

They basically cover scenarios in which people click around making multiple changes.

Anyway, I'm going to make myself another cup of tea and then on to part 6.

jamesquinlan
Автор

Awesome stuff David! You're handling some serious use cases. Hats off to you Sir 🎩

mass
Автор

hey, i need some help, i have the exact code as provided but my email validation does not seem to work? if i enter an email that is already taken, i do not recieve any message saying its avaliable or taken and im not sure how to fix this issue

m_____
Автор

Property 'map' does not exist on type 'Observable<Response>'. i got error like this. How to solve this error.

geethanjalibaskaran
Автор

Love the tutorial. There is a bug in the code. If the user were to go to the registration form and click in the email or username field then click into another field without entering anything. An error happens because it tries to enter a blank field. I fixed this by adding in the register.components.ts before calling the function. This should fix the problem. Make sure to do the same for both username and email. cheers

roccopietrangelo
Автор

with angular 6 if u get stuck on the data.success part assign it to this.message first then u can access this.message.data

bigcaka
Автор

Success should be set to TRUE not false if Username/Email are available. Otherwise the submit button will be disabled.

diavloify
Автор

check existing username and email doesn't work. please help me.

quanbui-hbgf
Автор

I keep getting these errors:
ERROR in src/app/services/auth.service.ts(16, 76): error TS2339: Property 'map' does not exist on type 'Observable<Response>'.
../node_modules/rxjs-compat/operator/map.d.ts(1, 28): error TS2307: Cannot find module 'rxjs'.
I wasn't able to fix it, please help

Punamuetsike
Автор

Can you write a sample password please? I do not understand the structure of the slogan

אבירןיוספי
Автор

Hello, your tutorial is help me a lot, thank you very much but I have a problem." Error: ENOENT: no such file or directory, stat . I already do all the thing same of you but still stuck, can't wait to see your reply. Im using MacOS

caolamnguyen
visit shbcf.ru