Leff7's avatar
Level 4

Angular 2 - template parse error for an input parameter in the component

I am paginating posts in my component and I am sending the number of posts from the post component to pagination component to like this:

<pagination [items]="posts.length" (page-changed)="onPageChanged($event)"></pagination>

I have set up the pagination component and the parameter items like so:

export class PaginationComponent implements OnChanges {
  @Input() items: number;

But, I get an error:

EXCEPTION: Template parse errors:
Can't bind to 'items' since it isn't a known native property ("
        </select>
        <spinner [visible]="postsLoading"></spinner>
        <pagination [ERROR ->][items]="posts.length" (page-changed)="onPageChanged($event)"></pagination>
        <ul class="list-g"): PostsComponent@10:20

What am I doing wrong?

0 likes
0 replies

Please or to participate in this conversation.