rampuriyaaa
rampuriyaaa

Reputation: 5126

Angularjs image binding not working

I'm pretty much new to angularjs. I've a url which looks something like http:/abc. This url refers a image which keeps on changing, but in angular new image is not getting referenced for some reason. For example if the url referes to A image and I change the reference to B, url still referes the old image and to show new I've to reload the web page. It seems binding is not happening properly. The problem is so confusing that I'm not sure of which code snippet should I put here as a reference.

     Please find code snippted below

updatePicture(url: string) {
                    var self: any = this;
                    var profileData: any = this.func.getProfilefromcache();
                    var info: ng.IPromise<any> = this.profileService.func(profileData);
                    info.then(function (data: any): void {
                        if (data.data) {

                            var profileData: any = self.userProfileCacheService.getProfilefromcache();

             profileData.summary.pictureURL.value = url;//url image reference is updated

    self.userProfileCacheService.setProfilecache(profileData);

           self.$state.go('.', {}, { reload: true });

                        }
                        else {

                            self.$uibModalInstance.dismiss('close');
                            angular.element(document.querySelector('#overlay')).removeClass('active');
                        }
                    });
                    promiseBusinessCardInfo.catch(function (data: any) {
                        self.notificationAlert.showGlobalMessage();
                    });

Upvotes: 0

Views: 45

Answers (0)

Related Questions