6

My problem is I just want to preview a Lightning component in the developer console. There are a ton of ways to make lightning components in all sorts of other mediums, but I just want to click preview and see it. I believe I need to have a "dummy" lightning app to host it. An outline of what I have now is for the Component called "testApp.cmp"

<aura:component implements="force:appHostable">
////code
<h1>hello world, please display this</h1>
</aura:component>

and the Lightning App called "testApp.app":

<aura:application access="GLOBAL" extends="ltng:outApp"> 
   <aura:dependency resource="c.testApp"/>
</aura:application>
2
  • Question is little vague. Do you want to preview a component without the need for the application? Or are you unable to preview even with the application?
    – Avinash
    Commented Dec 29, 2017 at 15:45
  • @Avinash, I really just want the easiest way to display the lightning component. So I just want to see the "hello world" without having to add it to a tab or page
    – MMeadows
    Commented Dec 29, 2017 at 15:47

1 Answer 1

20

Having a dummy app for the purpose of previewing is typically what I do. You don't need Lightning Out for this, though. Just put the component directly in the app:

<aura:application extends="force:slds">
  <c:helloWorld />
</aura:application>
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .