Ist das normal, so zu nennen oder was ist die beste Nutzung weil nichts anderesWie verwende ich den ionischen Speicher?
this.storage.get('email').then((email) => {
this.storage.get('token').then((token) => {
this.http.get('https://app.dev/clients.json?login='+email+'&client_token='+token)
.map(res => res.json())
.subscribe(data => {
// we've got back the raw data, now generate the core schedule data
// and save the data for later reference
this.data = data;
resolve(this.data);
});
});
});
});
arbeitet ich
versuchtdata: any;
token: string;
phone:string;
constructor(private http: Http, public storage: Storage) {}
load() {
this.storage.get('token').then((token) => {
this.token = token;
});
this.storage.get('phone').then((phone) => {
this.phone = phone;
});
this.http.get('https://app.dev/clients.json?login='+this.phone+'&client_token='+this.token)
.map(res => res.json())
.subscribe(data => {
// we've got back the raw data, now generate the core schedule data
// and save the data for later reference
this.data = data;
resolve(this.data);
});
});
Aber this.phone = Telefon; ist nicht zugewiesen
Ich wünschte, ich könnte einfach this.storage.get ('Telefon') nennen und keine Versprechungen.
Kann 'this.phone = this.storage.get ('phone');'? – Huiting
Nein, es ist ein Versprechen. – flakerimi
Welche Art von Speicher verwenden Sie? – Huiting