How do I add an animation while loading an Angular 4 request?

Asked

Viewed 113 times

0

My service is like this:

export class ServicoService {

    constructor(private http:Http) { }

    public listar() {
        return this.http.get('aqui a url')
        .toPromise()
        .then(response => response.json());
    }

}

The code is working correctly, however I would like to give a Feedback to the user saying that the content is being loaded. How do I?

1 answer

0

You can extend the Angular HTTP service to intercept your asynchronous calls by showing the user a loading screen or wait for an example.

You can find an implementation in this gist

Browser other questions tagged

You are not signed in. Login or sign up in order to post.