Return data from promise


#1

I’m currently trying to read a value from a SOAP call, this value is returned like this:

{PASSWORDMD5: "OKOKOKOKOKLOK"}

This is my .ts code:

doLogin() {
      return this.privacyProvider.getPWD()
       .toPromise()
       .then((data: any) => {
          let res = data[1];
          console.log(res)
       })
       .catch(err => {
          console.log('Error', err);
          return err;
       })
     }

How can I read the value inside the {}?


#2

I’m getting NaN from this :

let count = parseInt(data[""]);
console.log(count)

#3

Solved. Missing ; at the end …:man_facepalming: