Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Injectable } from '@angular/core';
- import { HttpClient } from '@angular/common/http';
- import { UserForAuth } from '../types/user';
- @Injectable({
- providedIn: 'root'
- })
- export class UserService {
- // Адресът на API
- private apiUrl = 'http://localhost:3000';
- constructor(private http: HttpClient) { }
- register(
- username: string,
- email: string,
- password: string,
- rePassword: string
- ) {
- return this.http.post<UserForAuth>(`${this.apiUrl}/register`, {
- username,
- email,
- password,
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement