Я разрабатываю приложение для Android и iOS. Фотография появляется в представлении и изменена в режиме реального времени. [img]{{pictureusuariomenu}}[/img] < /code>
[b] pictureUsuariomenu < /strong> - это переменная, найденная в контроллере. Вот функция: < /p>
updateStoredImages(name) { this.storage.get(STORAGE_KEY).then(images => { let arr = JSON.parse(images); if (!arr) { let newImages = [name]; this.storage.set(STORAGE_KEY, JSON.stringify(newImages)); } else { arr.push(name); this.storage.set(STORAGE_KEY, JSON.stringify(arr)); }
let filePath = this.file.dataDirectory + name; let resPath = this.pathForImage(filePath); // alert(resPath); this.urlImage=resPath;
let newEntry = { name: name, path: resPath, filePath: filePath }; this.images=[]; //borrar las imagenes anteriores (no crear la lista de imagenes) this.images = [newEntry, ...this.images]; this.urlImage = this.images[0].path; this.colocarImagenEnProfile(this.urlImage); this.ref.detectChanges(); // trigger change detection cycle }); } < /code>