data: 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);
});
});
しかしthis.phone =電話をしようとした他に何も
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);
});
});
});
});
を作業していないので、このまたは何最善の使用だように呼び出すために、この正常です。割り当てられていません
私はthis.storage.get( 'phone')と約束はしません。
'this.phone = this.storage.get( 'phone');'を実行できますか? – Huiting
それは約束です。 – flakerimi
あなたはどのタイプのストレージを使用していますか? – Huiting