I've created an ng2 component which uses a child ng2 component. The child component represents a list item which gets bound within an ngForOf loop in the parent component:
<div *ngIf="blogPostListItems">
<ng-template ngFor blogPostListItem [ngForOf]="blogPostListItems | async">
<div>
<blog-post-list-item [blogPostListItem]="blogPostListItem"></blog-post-list-item>
</div>
</ng-template>
</div>
The following exception is getting logged to the console for each blogPostListItem in the collection:
"Unhandled Promise rejection: Template parse errors:
Can't bind to 'blogPostListItem' since it isn't a known property of 'blog-post-list-item'.
But a blogPostListItem property is defined in my blog-post-list-item.component.ts:
import { Component, Input, OnInit } from '@angular/core';
@Component({
selector: 'blog-post-list-item',
templateUrl: '../../../ng2/templates/blog-post-list-item.component.html'
})
export class BlogPostListItemComponent
{
blogPostListItem: Object;
}
So I'm confused about the error message being returned. Any idea why this error might be occurring?