1

I have important question, please help me as soon as possible

when im testing laravel part by postman - api works well unfortunetly on front i got problems with it. its like angular try to connect with api on 4200 port no 8000.

3
  • Welcome to SO .. you need to take a look stackoverflow.com/questions/34516651/… Commented Sep 29, 2020 at 9:14
  • Please don't make more work for other people by vandalizing your posts. By posting on the Stack Exchange network, you've granted a non-revocable right, under the CC BY-SA 4.0 license, for Stack Exchange to distribute that content (i.e. regardless of your future choices). By Stack Exchange policy, the non-vandalized version of the post is the one which is distributed. Thus, any vandalism will be reverted. If you want to know more about deleting a post please see: How does deleting work? Commented Sep 30, 2020 at 13:02
  • Please add code and data as text (using code formatting), not images. Images: A) don't allow us to copy-&-paste the code/errors/data for testing; B) don't permit searching based on the code/error/data contents; and many more reasons. Images should only be used, in addition to text in code format, if having the image adds something significant that is not conveyed by just the text code/error/data. Commented Sep 30, 2020 at 13:06

1 Answer 1

0

You create code like that...

    import { Injectable, EventEmitter } from '@angular/core';
    import { HttpClient } from '@angular/common/http';
    import { Observable } from 'rxjs';
    
    @Injectable({
      providedIn: 'root'
    })
    export class FileService {
    
      refressFileList: EventEmitter<string> = new EventEmitter();
    
      constructor(
        private http: HttpClient
      ) { }

getBooks(): Observable<Book[]> {
        return this.http
            .get<Book[]>('http://www.localhost:8000/api/books')
            .pipe(catchError(this.handleError('getBooks', [])));
    }
    
      getData(params: any): Observable<any> {
        return this.http.get<any>('http://www.localhost:8000/api/books', params);
      }
    }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.