How can we set the full path of the image using getAbsoluteUrlOfNonManagedResources()?

It is possible to convert the short path of the image to the full path using ‘getAbsoluteUrlOfNonManagedResources()’. Currently, use the short URL ‘img/imagename.jpg’ when extracting the image URL from the configuration record for easy modification. However, in some cases, the image may not be fetched, and that’s when we use this method. With this method, the image URL is changed to the full image URL.

getContext: function getContext() {

                var carouselDetails = SC.CONFIGURATION.homepageprofessional.config;

                carouselDetails[0].target = “_blank”;

                var favoriteImages = _.map((carouselDetails || []), function map(image) {

                    image.ProductImageLink = Utils.getAbsoluteUrlOfNonManagedResources(image.ProductImageLink);

                    return image;

                });

                return {

                    favoriteImages: favoriteImages

                }

            }

Leave a comment

Your email address will not be published. Required fields are marked *