I'm trying to reference a file in my Static References in a Lightning component Controller.js file.
In my component file I would do this using the following pattern: src="{!$Resource.FutureStatePortalV1 + '/assets/images/SVG/preview.svg'}"
. This renders the correct path to the static resources file in the Salesforce site.
I attempted this same thing in controller.js:
previewIcon.src = "{!$Resource.FutureStatePortalV1 + '/assets/images/SVG/preview-hide.svg'}";
However, this just renders a string value of src="{!$Resource.FutureStatePortalV1 + '/assets/images/SVG/preview-hide.svg'}"
Is there a way to do this from the Controller.js?