Skip to main content
added 30 characters in body; added 195 characters in body
Source Link

Instead of using window.location.href , you can just define an attribute in your component

    <aura:component implements="forceCommunity:availableForAllPageTypes" access="global" > <aura:attribute name="url" type="String" /> <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> <p>{!v.url}</p>
<aura:attribute name ="url" type="String"/>
 </aura:component

<aura:attribute name ="url" type="String"/> </aura:component>

 

And also add an attribute to push URL variable from your lightning app and set in your component.

    <aura:application >
<aura:attribute name ="url" type="String"/>
 <c:WindowLocation  url="{!v.url}/>
 </aura:application>

<aura:attribute name ="url" type="String"/> <c:WindowLocation url="{!v***I've used this approach to get URL parameters and instead of splitting URL from getting it using location.url}/> </aura:application>href. while in your case you can try to get URL using $A.get('$Resource.SLDSv2') ***

Instead of using window.location.href , you can just define an attribute in your component

<aura:component implements="forceCommunity:availableForAllPageTypes" access="global" > <aura:attribute name="url" type="String" /> <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> <p>{!v.url}</p>

<aura:attribute name ="url" type="String"/> </aura:component>

And also add an attribute to push URL variable from your lightning app and set in your component.

<aura:application >

<aura:attribute name ="url" type="String"/> <c:WindowLocation url="{!v.url}/> </aura:application>

Instead of using window.location.href , you can just define an attribute in your component

    <aura:component implements="forceCommunity:availableForAllPageTypes" access="global" > <aura:attribute name="url" type="String" /> <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> <p>{!v.url}</p>
<aura:attribute name ="url" type="String"/>
 </aura:component
 

And also add an attribute to push URL variable from your lightning app and set in your component.

    <aura:application >
<aura:attribute name ="url" type="String"/>
 <c:WindowLocation  url="{!v.url}/>
 </aura:application>

***I've used this approach to get URL parameters and instead of splitting URL from getting it using location.href. while in your case you can try to get URL using $A.get('$Resource.SLDSv2') ***

Source Link

Instead of using window.location.href , you can just define an attribute in your component

<aura:component implements="forceCommunity:availableForAllPageTypes" access="global" > <aura:attribute name="url" type="String" /> <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> <p>{!v.url}</p>

<aura:attribute name ="url" type="String"/> </aura:component>

And also add an attribute to push URL variable from your lightning app and set in your component.

<aura:application >

<aura:attribute name ="url" type="String"/> <c:WindowLocation url="{!v.url}/> </aura:application>