Activity Forums Salesforce Questions and Answers How to use static resources in Lightning Application in salesforce ?

  • How to use static resources in Lightning Application in salesforce ?

  • shradha jain

    Member
    August 31, 2018 at 6:59 am

    How to use static resources in Lightning Application in salesforce?

  • madhulika shah

    Member
    August 31, 2018 at 7:36 am

    Hi Shradha,

    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">
    <a href="#" class="navbar-brand">Lightning Contacts</a>
    </div>
    </div>
    </div>

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

    </aura:application>

     

     

  • shariq

    Member
    September 19, 2018 at 12:26 am

    Hi,

    $Resource
    The $Resource global value provider lets you reference images, style sheets, and JavaScript code you’ve uploaded in static resources.
    Using $Resource lets you reference assets by name, without worrying about the gory details of URLs or file paths. You can use $Resource in Lightning components markup and within JavaScript controller and helper code.

    <aura:component>
    <!-- Stand-alone static resources -->

    <!-- Asset from an archive static resource -->


    </aura:component>

    Hopes this helps.

Viewing 1 - 3 of 3 posts

Log in to reply.

Original Post
0 of 0 posts June 2018
Now