• Artur Kolasa 7
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies
Please advise me which one solution is better for communicating across components. Because for me they are similar to each other.
Hi
I have problem in my project, because i have application components with a lot of components and i have to define some constance to use them across all components in application. What is the best approach for this? Currently I define a lot of attributes with default text value and I use them as constans but i think that isn't the best solution.
 
Please advise me which one solution is better for communicating across components. Because for me they are similar to each other.
While going through one of the lightning tutorial on trailhead [trailhead topic you can find here "https://trailhead.salesforce.com/projects/slds-lightning-components-workshop/steps/slds-lc-4" ] I feal some code is missing in the code provided here.

In this para "Create the AccountList Component" part of code provided is.

<form class="account-form" onsubmit="{!c.deleteAccount}"> <input type="hidden" value="{!account.Name}" class="account-name" /> <!-- Use a Lightning Base Component To display an icon next to the label --> <lightning:button label="Delete" iconName="utility:delete" iconPosition="left" variant="destructive" /> </form>

on click of the lightning button the form should submit, and deleteAccount event should fire but its not happing. So I added "type='Submit'" property in the lightning button and then it worked. Lightning button now looks like.
<lightning:button type='Submit' label="Delete" iconName="utility:delete" iconPosition="left" variant="destructive" />.

I know this is how it works in Javascript but i am not sure about lightning. Please let me know is this the right way or am I missing something.

Thanks


 
Hi
I have problem in my project, because i have application components with a lot of components and i have to define some constance to use them across all components in application. What is the best approach for this? Currently I define a lot of attributes with default text value and I use them as constans but i think that isn't the best solution.