I am trying to do a custom component like this and I want use the ngfor data to show information. This is my code:
my component:
import { Component, Input } from '@angular/core';
@Component({
selector: 'content-info',
templateUrl: 'content-info.html'
})
export class contentInfo {
@Input() content: any;
constructor() {}
}
<div class="container-content" *ngFor="let c of content">
<div class="name" *ngIf="content.name">
<div>{{content.name}}</div>
</div>
<div class="details">
{{content.details}}
</div>
</div>
then in the page i have this
<content-info [content]="datalist"></content-info>
but it shows nothing