I am new to angular 2 and what I did is use the angular infinite scroll and load the data when the scroll is scrolled but it prompt some error cannot bind property I illustrated below error :
install angular 2-infinite-scroll
import { NgModule, enableProdMode, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpModule } from '@angular/http';
import { FormsModule } from '@angular/forms';
import { Routes } from '@angular/router';
import { AppComponent } from './app/app.component';
/* Feature Modules */
import { DatepickerModule } from 'ng2-bootstrap/ng2-bootstrap';
import { PlanModule } from './plan.module';
import { InfiniteScrollModule } from 'angular2-infinite-scroll';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
enableProdMode();
@NgModule({
imports: [
BrowserModule,
HttpModule,
FormsModule,
DatepickerModule.forRoot(),
PlanModule,
InfiniteScrollModule
],
declarations: [],
bootstrap: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class AppModule { }
platformBrowserDynamic().bootstrapModule(AppModule);
add html page
<div id="activityList" *ngIf="structure.jobplan" infinite-scroll
[infiniteScrollDistance]="2"
[infiniteScrollThrottle]="300"
(scrolled)="bindActivitiesOnScroll($event)" >
then i got error :
Uncaught Error: Template parse errors:
Can't bind to 'infiniteScrollDistance' since it isn't a known property of 'div'. ("
<div id="activityList" *ngIf="structure.jobplan" infinite-scroll
[ERROR ->][infiniteScrollDistance]="2"
[infiniteScrollThrottle]="300"
(scrolled)="bindAct"): ng:///ActivityModule/ActivityListComponent.html@5:12
Can't bind to 'infiniteScrollThrottle' since it isn't a known property of 'div'. ("t" *ngIf="structure.jobplan" infinite-scroll
[infiniteScrollDistance]="2"
[ERROR ->][infiniteScrollThrottle]="300"
(scrolled)="bindActivitiesOnScroll($event)" >
"): ng:///ActivityModule/ActivityListComponent.html@6:12
at syntaxError (index.ts:26)
at TemplateParser.parse (index.ts:26)
at JitCompiler._compileTemplate (index.ts:26)
at index.ts:26
at Set.forEach (<anonymous>)
at JitCompiler._compileComponents (index.ts:26)
at index.ts:26
at Object.then (index.ts:26)
at JitCompiler._compileModuleAndComponents (index.ts:26)
at JitCompiler.compileModuleAsync (index.ts:26)
i googled but cant find a solution why it does not allowing to bind property, couldn't find where i made mistake please help me