I'm working on a Sitecore JSS site, Angular framework, disconnected mode.

I'm trying to access the SRC attribute of an image field in my components ngOnInit method. Stepping through the code, it looks like what I've got is right, but the compiler says that "value" does not exist. The line in question looks like:

this.heroImage = this.rendering.fields.heroImage.value.src;

How do I correctly retrieve the SRC attribute of the image?

Note: this.heroImage is a string.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.