1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Angular asyn - how to get the string of an asyn method

Discussão em 'Angular' iniciado por quma, Outubro 20, 2024.

  1. quma

    quma Guest

    I use this service class in order to get the network status:

    @Injectable()
    export class NetworkConnectionService {

    constructor() {
    }

    addNetworkConnectionListener() {
    Network.addListener('networkStatusChange', status => {
    console.log('Network status changed', status);
    });
    }

    async getCurrentNetworkStatus() {
    const self = this;
    const currentNetworkStatus = async () => {
    const status = await Network.getStatus();
    };
    return currentNetworkStatus;
    }
    }


    and I want to get the status string in order to print it in html. How do I get this string?

    Continue reading...

Compartilhe esta Página