Skip to main content
Linking Summer 18 release to the new lightning interface
Source Link

After Summer 18 releaseSummer 18 release (API version 43 and up) we can do this.

Implement lightning:isUrlAddressable interface and use pageReference attribute.

Example. - Component Assume url is https://<instance>.lightning.force.com/lightning/cmp/<namespace>__componentName?testAttribute=abc

<aura:component implements="lightning:isUrlAddressable">
   <aura:handler name="init" value="{!this}" action="{!c.doInit}" description="Handler for valueInit event fired when the component has been initialised"/>
        {!v.pageReference.state.testAttribute}
</aura:component>

Component Controller

({
    doInit : function(component, event, helper) {
        console.log(component.get("v.pageReference").state.testAttribute);
    }
})

Console output will look like: "abc"

After Summer 18 release (API version 43 and up) we can do this.

Implement lightning:isUrlAddressable interface and use pageReference attribute.

Example. - Component Assume url is https://<instance>.lightning.force.com/lightning/cmp/<namespace>__componentName?testAttribute=abc

<aura:component implements="lightning:isUrlAddressable">
   <aura:handler name="init" value="{!this}" action="{!c.doInit}" description="Handler for valueInit event fired when the component has been initialised"/>
        {!v.pageReference.state.testAttribute}
</aura:component>

Component Controller

({
    doInit : function(component, event, helper) {
        console.log(component.get("v.pageReference").state.testAttribute);
    }
})

Console output will look like: "abc"

After Summer 18 release (API version 43 and up) we can do this.

Implement lightning:isUrlAddressable interface and use pageReference attribute.

Example. - Component Assume url is https://<instance>.lightning.force.com/lightning/cmp/<namespace>__componentName?testAttribute=abc

<aura:component implements="lightning:isUrlAddressable">
   <aura:handler name="init" value="{!this}" action="{!c.doInit}" description="Handler for valueInit event fired when the component has been initialised"/>
        {!v.pageReference.state.testAttribute}
</aura:component>

Component Controller

({
    doInit : function(component, event, helper) {
        console.log(component.get("v.pageReference").state.testAttribute);
    }
})

Console output will look like: "abc"

Escaping gt and lt html characters so the url shows properly
Source Link

After Summer 18 release (API version 43 and up) we can do this.

Implement lightning:isUrlAddressable interface and use pageReference attribute.

Example. - Component Assume url is https://<instance>.lightning.force.com/lightning/cmp/__component name<namespace>__componentName?testAttribute=abc

<aura:component implements="lightning:isUrlAddressable">
   <aura:handler name="init" value="{!this}" action="{!c.doInit}" description="Handler for valueInit event fired when the component has been initialised"/>
        {!v.pageReference.state.testAttribute}
</aura:component>

Component Controller

({
    doInit : function(component, event, helper) {
        console.log(component.get("v.pageReference").state.testAttribute);
    }
})

Console output will look like: "abc"

After Summer 18 release (API version 43 and up) we can do this.

Implement lightning:isUrlAddressable interface and use pageReference attribute.

Example. - Component Assume url is https://.lightning.force.com/lightning/cmp/__component name?testAttribute=abc

<aura:component implements="lightning:isUrlAddressable">
   <aura:handler name="init" value="{!this}" action="{!c.doInit}" description="Handler for valueInit event fired when the component has been initialised"/>
        {!v.pageReference.state.testAttribute}
</aura:component>

Component Controller

({
    doInit : function(component, event, helper) {
        console.log(component.get("v.pageReference").state.testAttribute);
    }
})

Console output will look like: "abc"

After Summer 18 release (API version 43 and up) we can do this.

Implement lightning:isUrlAddressable interface and use pageReference attribute.

Example. - Component Assume url is https://<instance>.lightning.force.com/lightning/cmp/<namespace>__componentName?testAttribute=abc

<aura:component implements="lightning:isUrlAddressable">
   <aura:handler name="init" value="{!this}" action="{!c.doInit}" description="Handler for valueInit event fired when the component has been initialised"/>
        {!v.pageReference.state.testAttribute}
</aura:component>

Component Controller

({
    doInit : function(component, event, helper) {
        console.log(component.get("v.pageReference").state.testAttribute);
    }
})

Console output will look like: "abc"

Source Link
Ranga
  • 1.7k
  • 1
  • 14
  • 25

After Summer 18 release (API version 43 and up) we can do this.

Implement lightning:isUrlAddressable interface and use pageReference attribute.

Example. - Component Assume url is https://.lightning.force.com/lightning/cmp/__component name?testAttribute=abc

<aura:component implements="lightning:isUrlAddressable">
   <aura:handler name="init" value="{!this}" action="{!c.doInit}" description="Handler for valueInit event fired when the component has been initialised"/>
        {!v.pageReference.state.testAttribute}
</aura:component>

Component Controller

({
    doInit : function(component, event, helper) {
        console.log(component.get("v.pageReference").state.testAttribute);
    }
})

Console output will look like: "abc"