Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[object Object], when set a variable of array type previously created in this.items #71

Closed
LauraNavarroGalvan opened this issue Jun 13, 2018 · 7 comments
Labels

Comments

@LauraNavarroGalvan
Copy link

LauraNavarroGalvan commented Jun 13, 2018

When I have an array saved in the local storage, I get it and try to add it to this.items the view shows me [object Object], but when I console this.items it's fine.

let content = JSON.parse(localStorage.getItem('downloadedForms'));
this.items = new BehaviorSubject(content);

but works if I do the following

let content = JSON.parse(localStorage.getItem('downloadedForms'));
this.http.get(environment.url_authentication + 'forms/' + id + '/prefered', { })
              .subscribe((result) => {
			this.items = new BehaviorSubject(content);
		}, (error) => {
			this.items = new BehaviorSubject(content);
		});
@triniwiz triniwiz added the bug label Nov 13, 2018
@triniwiz
Copy link
Owner

triniwiz commented Dec 2, 2018

Can you try the latest version :)

@triniwiz
Copy link
Owner

triniwiz commented Dec 8, 2018

Fixed in the latest

@triniwiz triniwiz closed this as completed Dec 8, 2018
@wuilmerj24
Copy link

@triniwiz In version 12.0.0-alpha.8 for angular the same thing happens. Use your demo-ng test example and it does the same.

@triniwiz
Copy link
Owner

@wuilmerj24 try using an ObservableArray

@wuilmerj24
Copy link

@triniwiz If that is what I am using.
private items:ObservableArray<any>; constructor(){ this.items = new ObservableArray([ { title: 'Slide 1', image: '~/images/Hulk_(comics_character).png' }, ]) }

<Pager row="0" [items]="items" #pager (selectedIndexChange)="onIndexChanged($event)" class="pager" backgroundColor="lightsteelblue"> <ng-template let-item="item"> <StackLayout> <Label [text]="item.title" textWrap="true"></Label> </StackLayout> </ng-template> </Pager>

@wuilmerj24
Copy link

@triniwiz The problem is lazy loading. It already works correctly.

@triniwiz
Copy link
Owner

Can you send a demo with the bug please I’ll dig into it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants