0

What is the purpose of $ContentAsset provider? Why can't $Resource always be used? Is there any point of storing images, style sheets, and JavaScript in some other places rather than in StaticResources?

I am struggling to understand the purpose of $ContentAsset provider. Is this provider to reach some Static Resources loaded not into Static Resources but somewhere in community builder or some other place? Is that related to Asset standard object or is this stored in completely different standard object?

What is the purpose of this functionality if everyone could use Static Resources and $Resource to reference images, style sheets, and JavaScript assets?

1

$ContentAsset represents a Global value that a component can use in expressions. Lightning Components can be used in many places, not just within an Org on Lightning and Visualforce Pages. They can also be used in external Communities and in other places outside of Salesforce when configured using Lightning Out. Depending on the use case, resources and content needed by a component could be stored in very different locations other than as part of an org's static resources. $ContentAsset allows components to access their resources from these other locations.

  • Do you mean that external Communities can't access Static Resources? – Patlatus Feb 11 at 9:37
  • Communities generally store their assets in a different location than the internal org and use Community Builder rather than Setup. – crmprogdev Feb 11 at 14:50

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.