I am using NativeScript version 6.0 and after successful upload of an image using nativescript-background-http i have created a task complete handler inside i call a function to update array which updates UI but UI is not updating and variable show new data in the console.
here is sample code:
var that=this;
context
.authorize()
.then(function() {
return context.present();
})
.then(function(selection) {
selection.forEach(function(selected) {
var file = selected.android;
var name = file.substr(file.lastIndexOf("/") + 1);
var fileExt=file.substr(file.lastIndexOf(".") + 1);
I have shown gallery variable in .html file using *ngFor it shows some default image but after task complete, a new object is pushed but it not update UI
I am using NativeScript version 6.0 and after successful upload of an image using nativescript-background-http i have created a task complete handler inside i call a function to update array which updates UI but UI is not updating and variable show new data in the console. here is sample code: var that=this; context .authorize() .then(function() { return context.present(); }) .then(function(selection) { selection.forEach(function(selected) { var file = selected.android; var name = file.substr(file.lastIndexOf("/") + 1); var fileExt=file.substr(file.lastIndexOf(".") + 1);
fetch_img(){ this.gallery.push({"name":"image.jpg"}); console.log(this.gallery); }
I have shown gallery variable in .html file using *ngFor it shows some default image but after task complete, a new object is pushed but it not update UI