Activity Forums Salesforce® Discussions How to include static resource in lightning component in Salesforce?

  • Anjali

    Member
    July 27, 2018 at 7:56 am

    Hi Shradha

    To reference a specific resource in component markup, use $Resource.resourceName within an expression. resourceName is the Name of the static resource. In a managed packaged, the resource name must include the package namespace prefix, such as $Resource.yourNamespace__resourceName. For a stand-alone static resource, such as an individual graphic or script, that’s all you need. To reference an item within an archive static resource, add the rest of the path to the item using string concatenation.

  • shariq

    Member
    September 19, 2018 at 1:22 am

    Hi,

    To use static resources in Lightning Application in salesforce, implement the application as follows:

    <aura:application>

    <link href=’/resource/bootstrap/’ rel=”stylesheet”/>

    <div class=”navbar navbar-default navbar-static-top” role=”navigation”>
    <div class=”container”>
    <div class=”navbar-header”>
    Lightning Contacts
    </div>
    </div>
    </div>

    <div class=”container”>
    <div class=”row”>
    <div class=”col-sm-12″>
    Contact list goes here
    </div>
    </div>
    </div>

    </aura:application>

    Hope this helps.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos