Wie werde ich Typoskript-Fehler für die Datenstruktur los, die in eine then
Versprechung übergeben wurde?Eigenschaft 'count' existiert nicht für den Typ '{'} '
Ich erhalte die folgende Fehlermeldung:
Property 'count' does not exist on type '{}'
Für den folgenden Code:
this.userData.getSocialLinks(this.navParams.get('image_owner_id')).then(socialLinks => {
var i = 0;
for (i=0; i < socialLinks.count; i++) {
if (socialLinks.results[i].social_type == 'TW') {
this.profile.twitter = socialLinks.results[i].social_address;
this.isExistingTW = true;
this.twEntryID = socialLinks.results[i].id;
}
else if (socialLinks.results[i].social_type == 'IN') {
this.profile.instagram = socialLinks.results[i].social_address;
this.isExistingIN = true;
this.inEntryID = socialLinks.results[i].id;
}
}
});
Ich vermute, ich habe socialLinks
irgendwie zu definieren, aber wo nicht funktioniert.
funktioniert perfekt dank verwenden. –