OiO.lk Blog javascript Angular async – how to get the string of an async method
javascript

Angular async – how to get the string of an async method


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);
    });
}

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?



You need to sign in to view this answers

Exit mobile version