javascript - "Can't bind to 'myComponentProperty' since it isn't a known property of 'myComponent'" -
i've created ng2 component uses child ng2 component. child component represents list item gets bound within ngforof loop in 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 getting logged console each blogpostlistitem in collection:
"unhandled promise rejection: template parse errors: can't bind 'blogpostlistitem' since isn't known property of 'blog-post-list-item'.
but blogpostlistitem property defined in blog-post-list-item.component.ts:
import { component, input, oninit } '@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 error message being returned. idea why error might occurring?
Comments
Post a Comment