Skip to content

Instantly share code, notes, and snippets.

@jamigibbs
Created January 8, 2020 16:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamigibbs/1575bb93446756f23d8b8e609951dd63 to your computer and use it in GitHub Desktop.
Save jamigibbs/1575bb93446756f23d8b8e609951dd63 to your computer and use it in GitHub Desktop.
Get Page Ref
import { LightningElement, wire } from 'lwc';
import { CurrentPageReference } from 'lightning/navigation';
export default class PageRefDemo extends LightningElement {
@wire(CurrentPageReference)
currentPageReference;
handleDisplayPageRefObj(){
const pageRefObj = JSON.stringify(this.currentPageReference, null, 4);
console.log(pageRefObj);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment