You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

How to give {{application.path}} in custom component?

edited Jun 28, 2019 10:46AM in Visual Builder 1 comment

Content

Hi 

I am using custom component 'mfe-file-picker' where I need to give the image path as {{application.path}} so that if migrated to new version then also it should take application path instead of hardcoding the src image path.

PFB the HTML

 <img slot="startIcon" data-bind="attr: { src: droparea}"/>

PFB the JS

 self.properties = context.properties;
 self.fullPath = self.properties.applicationPath;
 self.droparea = ko.observable('');

self.droparea(self.fullPath + 'resources/images/dropArea_arrow_ena.png');

I hope that the question is clear that instead of hardcoding like

"<img slot="startIcon" :src="../../webApps/csp/resources/images/dropArea_arrow_ena.png">"

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!