fix(examples): hide "undefined" domain in HN example

This commit introduces a null-undefined check against the domain of the HN items in the Hacker News example.
pull/4643/head
Robin Cussol 6 years ago committed by GitHub
parent d7497deaec
commit 738e8b1261
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -26,7 +26,9 @@
<article> <article>
<a href="{item.url}"> <a href="{item.url}">
<h1>{item.title}</h1> <h1>{item.title}</h1>
<small>{item.domain}</small> {#if item.domain != null}
<small>{item.domain}</small>
{/if}
</a> </a>
<p class="meta">submitted by {item.user} {item.time_ago} <p class="meta">submitted by {item.user} {item.time_ago}
@ -36,4 +38,4 @@
{#each item.comments as comment} {#each item.comments as comment}
<Comment {comment}/> <Comment {comment}/>
{/each} {/each}
</div> </div>

Loading…
Cancel
Save