Can't bind to 'inViewportOptions' since it isn't a known property of 'div' - after upgrading from angular 5 to 7
liluxdev opened this issue · 6 comments
ERROR in : Can't bind to 'inViewportOptions' since it isn't a known property of 'div'. ("rator | date: 'dd/MM/yyyy'}}</span></div>
<div *ngIf="!entry.dateSeparator"
in-viewport [ERROR ->][inViewportOptions]="{ rootElement: messageContainerInner, partial: false }"
(inViewportAction)")
I'm using it in a modular app:
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
// containers
import { MessengerComponent } from './messenger.component';
import { SharedModule } from '../shared.module';
import { InViewportModule } from 'ng-in-viewport';
// routes
export const ROUTES: Routes = [
{ path: '', component: MessengerComponent }
];
@NgModule({
imports: [
SharedModule,
InViewportModule,
RouterModule.forChild(ROUTES)
],
declarations: [
MessengerComponent
]
})
export class MessengerModule { }
Note: with version 5 I imported it with InViewportModule.forRoot() now .forRoot() disappeared
@CreativeProgramming did you manage to solve your issue by yourself?
@CreativeProgramming I'm having the same issue.Please help to resolve .Also, inViewportAction is not getting called.I don't understand the issue.
@SimranChawla1995
i have same issue with you, @k3nsei could you please help me, I used the version of 6.0.3.
I did import the InViewPortModule in my module. and use the in-view-port directive in my page:
<div #RecentServiceCalls [inViewportOptions]="{ partial: true, threshold: [0, 1] }" in-viewport (inViewportAction)="showTab('aRecentServiceCalls')"> <customer-recent-service-call id="RecentServiceCalls"></customer-recent-service-call> </div>
first, i got error like can not bind 'inViewportOptions', and after remove the 'inViewportOptions' in my html code, i did not get any event when my element scroll into my view either.
I got the same problem, is there a fix?
You need import InViewportModule in your module.
Here is working example https://stackblitz.com/edit/ng-in-viewport-issues-230