Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Property expression section does not provide a concrete example how to access JavaScript property in Child Web Component #1181

Closed
projektorius96 opened this issue Sep 6, 2023 · 1 comment

Comments

@projektorius96
Copy link

In reference to Property Expression please provide a concrete example depicting the access to the JavaScript property in Child Web Component ; elaborating on what is given by the documentation at section [Property Expression], consider the following:

html`<my-list .listItems=${this.items}></my-list>`;

In accordance to this answer on stackoverflow the JavaScript property .listItems passed to custom element my-list in Child Web Component should be access as follows:

class MyList extends LitElement {
 /* ... */
  render() {
    return html `<p>${this.listItems}</p>`
   }
/* ... */
}
customElements.define('my-list ', MyList);

This should be clearly outlined from day number one, without forcing to end up on sites like StackOverflow ...

Thank you.

@projektorius96
Copy link
Author

Up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

1 participant