Angular Web App
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

register-business-name.service.ts 613 B

1234567891011121314151617181920212223242526
  1. import { Injectable } from '@angular/core';
  2. import { HttpClient, HttpHeaders } from '@angular/common/http';
  3. import { Observable, throwError } from 'rxjs';
  4. import { catchError, retry } from 'rxjs/operators';
  5. export interface NameCheckResponse {
  6. status: string;
  7. }
  8. @Injectable({
  9. providedIn: 'root'
  10. })
  11. export class RegisterBusinessNameService {
  12. constructor(private http: HttpClient) {
  13. }
  14. checkName(name: string) {
  15. const nameRequest = {
  16. name,
  17. };
  18. return this.http.post<NameCheckResponse>('http://localhost:10000/name-check/', nameRequest).toPromise();
  19. }
  20. }