0

here is design atrribute @api parentcls and childcls i m trying to fetch these design attribute in another component on same page i tried constructor too but didnt get value on load

@api parentcls='';
@api childcls='';

connectedCallback(){
    console.log('connectedcallback',this.parentcls); //value getting
    console.log('connectedcallback',this.childcls); //value getting 
    fireEvent(this.pageRef, 'parentclass', this.parentcls);
    fireEvent(this.pageRef, 'childclass', this.childcls);
}

in another component of same page

connectedCallback() {
    registerListener('parentclass', this.parentcss, this);
    registerListener('childclass', this.childcss, this);
}
3
  • can you show what is fireEvent? – salesforce-sas Aug 5 '19 at 6:57
  • import {fireEvent} from 'c/pubsub'; event from main component to send values @salesforce-sas – sfdc Aug 5 '19 at 7:20
  • Can you show full code? there are multiple steps involved in using pubsub, so will be able to help better if I acn see full flow – salesforce-sas Aug 6 '19 at 8:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.