Angular example

Hello,

Can somebody please help me with this angular example. I can not find why my data form contacts.json file is not displaying in contact-list.component.html(contacts tab in the navbar). I don’t see an error message and the data is displaying just on the console.Wonder if I am dong everything correctly.

Here is a link:

Thank you !!!

You just forgot to show contact-list component on HomeComponent.

it’ll work if you:
on home.component.ts declare: visible = false;

on home.component.html include this code:

<a class=“btn btn-lg btn-primary” (click)=“isVisible = !isVisible” role=“button”>View tutorial
<app-contact-list *ngIf=“isVisible”>

…and on contact-list.component.ts you need to modify onInit() to
this.contacts = data;

1 Like

Thank you so much, this worked! :slight_smile:

Thanks!!