How to return value of promise using angular 2
<p>This is my promise function i need to return the value of rs.rows.item(0);</p>

<pre><code>     public getCustomer()  : any
  {
        let  db =  window.sqlitePlugin.openDatabase({name: 'data.db', location: 'default'});
        return new Promise((resolve, reject) =&gt;
        {
            db.transaction(function(tx)
            {
                tx.executeSql('SELECT * FROM customer ORDER BY customerId DESC LIMIT 1', [], function(tx, rs)
                {
                     return resolve(rs.rows.item(0));
                }, 
                function(tx, error) 
                {
                    console.log('SELECT error: ' + error.message);
                    reject(error);
                });
            });
        });    
  }
</code></pre>

<p>the return value i got an object like this image <a href="https://i.stack.imgur.com/ILyem.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ILyem.png" alt="image result"></a>    </p>

<p>i need to get like this example</p>

<pre><code>var customer = getCustomer();
customer.name;
customer.email;
</code></pre>