Need to get in tile.js account info that available in tile.html Got 4 different components: selector, list(nesting selector), details(nesting selector), tile(nesting list). From apex controller passing query of accounts to list, and then 1 account with parameters to each tile. Need to get click from tile and pass clicked account info to detail component. Passing this.account.id in CustomEvent gives nothing or error. So how can i get any account data in js that i got in html(for example i got name {account.name} in html, but i cant get name like this.account.name in js), and be a pass it to parent component? Thanks in advance.

tile.html

<template> <a onclick={tileClick}> <img src={account.image__c} width="200" height="200" > Account Name: {account.Name} Account Owner: {account.OwnerId} Account Budget: {account.Budget__c} Account Employees Number: {account.NumberOfEmployees} Account Type : {account.type} </a> </template> 

tile.js

import { LightningElement, api, track } from 'lwc'; export default class Tile extends LightningElement { @api account; tileClick() { const event = new CustomEvent('tileclick', { detail: this.account.id }); this.dispatchEvent(event); } } 

Related questions 5 Accounts.onLogin how to get user Id? 0 Firebase: How to get the $id of an object after I authenticate using angularFire 22 Finding my AWS account ID using JavaScript Related questions 5 Accounts.onLogin how to get user Id? 0 Firebase: How to get the $id of an object after I authenticate using angularFire 22 Finding my AWS account ID using JavaScript 2 Retrieve ID of newly created user Firebase 0 How to get the uid of a registered user with ionic and firebase 0 Retreiving the id in console 0 How to get the data/id of the authenticated user? 0 How can I get the id of user in Angular 0 How to get the user id of the newly created user in firebase 1 Get user id after creating a user in firebase Load 7 more related questions Show fewer related questions

Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.