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

Make it possible to pass complex properties (objects, arrays) to element #94

Open
blikblum opened this issue Nov 8, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@blikblum
Copy link

blikblum commented Nov 8, 2021

Hi, just tried api-viewer but could not get how to pass an array to an element

The element, written in lit expects a property to be passed as array. It does not reflect to attribute.

I tried using lit-html as below without success:

import 'api-viewer-element'
import '../browserAction/patient-list.js'
import { html, render } from '../third-party/lit.js'

const patients = [{ name: 'João' }, { name: 'Maria' }]

const apiTemplate = html`
  <api-viewer src="../custom-elements.json">
    <template data-element="patient-list" data-target="host">
      <patient-list .patients=${patients}></patient-list>
    </template>
  </api-viewer>
`
render(apiTemplate, document.body)
@web-padawan web-padawan added the enhancement New feature or request label Nov 8, 2021
@web-padawan
Copy link
Collaborator

Thanks for the issue. This is not supported at the moment.
I need to think about how to handle this, without being tied to Lit templates.

@web-padawan web-padawan changed the title Is possible to pass complex primitives (objects, arrays) to element property? Make it possible to pass complex primitives (objects, arrays) to element property Nov 8, 2021
@web-padawan web-padawan changed the title Make it possible to pass complex primitives (objects, arrays) to element property Make it possible to pass complex properties (objects, arrays) to element Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants
@blikblum @web-padawan and others