Angular Web App
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

27 satır
613 B

  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. }