I have array of data saved in my native-storage but when i try to retrieve them i get this error:
Code
<ion-row *ngIf="items">
<ion-col size="12" *ngFor="let post of items | slice:0:limit | async">
<ion-card class="welcome-card">
<ion-card-header>
<ion-card-subtitle>{{post.created_at | date : "d.M.y"}} - by {{post.user}}</ion-card-subtitle>
<ion-card-title [routerLink]="['/', 'posts', post.url]">
{{post.title}}
</ion-card-title>
</ion-card-header>
</ion-card>
</ion-col>
</ion-row>
export class OfflinePage implements OnInit {
items: any[] = [];
constructor(
private storage: NativeStorage
) { }
ngOnInit() {
this.getFavorites();
}
getFavorites() {
return this.storage.getItem('item').then(
data => {
console.log(data);
this.items.push(data)
if (this.items != null) {
this.items = data;
} else {
this.items.push('You havn\'t add any article to offline mode.');
}
},
error => {
this.items = error;
}
);
}
}
Any idea?