Well, I found out that my approach was wrong. I don't know exactly how to
use onCheck, but after a few more tries I moved my logic from onCheck to
onInit like this
onInit() {
//console.log(this.http);
this.http.get('json/items_list.json')
.toRx()
.subscribe((res: Response) => {
let items = res.json().items;
let keys = Object.keys(items);
for(let i = 0; i < keys.length; i++) {
this.list_items.push({
name : tmp_items[keys[i]].name,
image : tmp_items[keys[i]].image
});
}
});
}
This way I don't need to use onCheck. And it fixed my issue. I hope it can
help someone.
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.