Ich habe ein Problem. Mein Service gibt ein Objekt mit mehr Array zurück, ich sende Navaramps für meine Seite ein und abonniere, aber auf meiner Seite gibt es beobachtbare, ich benutze nicht beobachtbar.eckig2 - Service gibt eine beobachtbare in abonnieren
Wie löste das?
Service
getInfoAccountById(id: any) {
this.module = 'accounts/' + id + '/infos';
let headers = new Headers();
headers.append(this.key, this.token);
return this.http.get(this.url + this.module, {
headers
}).map(res => res.json().Result)
}
primäre Seite nav params
constructor(public navCtrl: NavController, public navParams: NavParams, public acc: AccountService) {
this.navParams = navParams;
this.dataDetails = {
id: this.navParams.get('data').Id,
name: this.navParams.get('data').Identification,
complement: this.navParams.get('data').Complement,
account: this.navParams.get('data').AccountType.Identification,
pricelist: this.navParams.get('data').PriceList,
active: this.navParams.get('data').Active,
color:this.acc.getdetailsAccountById(this.navParams.get('data').Id).subscribe(data => { this.datad = data.Color; }),
informations:this.acc.getInfoAccountById(this.navParams.get('data').Id) // this line have a problem
};
}
sekundäre Seite params recevied
constructor(public navCtrl: NavController, public navParams: NavParams, public acc: AccountService, public http: Http) {
this.id = this.navParams.data.id;
this.name = this.navParams.data.name;
this.complement = this.navParams.data.complement;
this.account = this.navParams.data.account;
this.pricelist = this.navParams.data.pricelist;
this.active = this.navParams.data.active;
this.color = this.navParams.data.color;
this.infos = this.navParams.data.informations;
console.log(this.infos);
}
Wie haben Sie Observables verwaltet? –
Ich verwende keine Observables –