Ionic 2 basic: get user from storage and check username / password
<p>For a mobile app I use the ionic2 platform. The first screen is to log in, but I would remember the user information. Therefor I have created a Service (see below)
The problem is that I have this error:
Property 'email' does not exist on type '{}'.</p>

<p>The check for login is this one:</p>

<pre><code>var  dataUser = this.userService.getUser().then(dataUser =&gt; {
      console.log(JSON.stringify(dataUser));
        this.userService.checkUser(dataUser.email,dataUser.password).then(dataCheck =&gt; {
    if (dataCheck)  {
        this.userService.setUser(dataCheck);
        this.nav.setRoot(HomePage);
    } else {
        console.log("not correct");
    }
});

});
</code></pre>

<p>So it is on getting dataUser.email that he throws this error... But I can't find any solution to fix this unfortunatly :(</p>

<pre><code>import { Storage } from '@ionic/storage';
import {UserModel} from '../models/user.model'

@Injectable()
export class UserService {
   constructor(public http: Http, public storage: Storage) {
}

setUser(user) {
   this.storage.set('user',user);
}

getUser() {
   return new Promise(resolve =&gt; {
      this.storage.get('user').then((user) =&gt; {
        if (user != null) {
            resolve(user);
        } else {
            resolve(new UserModel()); 
        }
      });
    })
}

checkUser(email,password) {

}
</code></pre>