Just starting with lit-element
in my render i have:
return html`
${this.jobCreate}
${this.jobDetails}
`;
get jobCreate works fine
this is my get jobDetails:
get jobDetails() {
const jobs = [
{ name: "phoenix job", location: "phoenix", expires: "2020-10-01" },
{ name: "chicago job", location: "chicago", expires: "2020-10-01" },
{ name: "pittsburgh job", location: "pittsburgh", expires: "2020-10-01" },
];
return html`<ul>
${jobs.forEach((job) => html`<li>${job.name}</li>`)}
</ul>`;
}
inspecting the element i can see an empty <ul> set
if do a <ul><li>${jobs[2].name}</li></ul> that works
if i console out job, i can see all the right job print 3 times in the loop
I can't understand why i can't get the <li> to render in the loop
i used this for reference: https://lit-element.polymer-project.org/guide/templates#template-syntax-cheat-sheet