val2
This commit is contained in:
36
src/app/registration.service.ts
Normal file
36
src/app/registration.service.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
@Injectable()
|
||||
export class RegistrationService {
|
||||
|
||||
APIURL = "http://192.241.155.78/ludosdata/api.php";
|
||||
|
||||
constructor(
|
||||
private http: HttpClient
|
||||
){ }
|
||||
|
||||
/*
|
||||
validateUserName( userName ): Observable<any> {
|
||||
return this.http.get( "http://www.pugludos.com/registration.php?key=validation&type=username&value=" + userName )
|
||||
.map(res => {
|
||||
return(
|
||||
res
|
||||
);
|
||||
});
|
||||
}
|
||||
*/
|
||||
|
||||
validateUserName( userName ): Observable<any> {
|
||||
return this.http.get( this.APIURL + "/users?filter=email,cs," + userName + "&transform=1" )
|
||||
.map(res => {
|
||||
return(
|
||||
res
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user