Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue 5817 #5854

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,8 @@
"@schematics/angular:directive": {
"prefix": "ngx"
}
},
"cli": {
"analytics": "bc1499f9-0bc1-4ae6-ab35-867275a6a90f"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</nb-card>
</div>

<div class="col-md-12 col-lg-6 col-xxxl-6">
<div *ngIf="secondCard.news.length" class="col-md-12 col-lg-6 col-xxxl-6">
<nb-card>
<nb-card-header>Window Scroll</nb-card-header>
<nb-list
Expand Down
9 changes: 6 additions & 3 deletions src/app/pages/layout/infinite-list/infinite-list.component.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { NewsService } from '../news.service';

@Component({
selector: 'ngx-infinite-list',
templateUrl: 'infinite-list.component.html',
styleUrls: ['infinite-list.component.scss'],
})
export class InfiniteListComponent {
export class InfiniteListComponent implements OnInit{


firstCard = {
Expand All @@ -24,7 +24,10 @@ export class InfiniteListComponent {
pageSize = 10;

constructor(private newsService: NewsService) {}

ngOnInit() {
this.loadNext(this.firstCard);
this.loadNext(this.secondCard);
}
loadNext(cardData) {
if (cardData.loading) { return; }

Expand Down