This commit is contained in:
ngdevnilesh 2024-11-29 00:51:11 +00:00 committed by GitHub
commit 589bc934ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 5 deletions

View file

@ -187,5 +187,8 @@
"@angular-eslint/schematics:library": {
"setParserOptionsProject": true
}
},
"cli": {
"analytics": "bc1499f9-0bc1-4ae6-ab35-867275a6a90f"
}
}
}

View file

@ -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

View file

@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { NewsService } from '../news.service';
@Component({
@ -6,7 +6,7 @@ import { NewsService } from '../news.service';
templateUrl: 'infinite-list.component.html',
styleUrls: ['infinite-list.component.scss'],
})
export class InfiniteListComponent {
export class InfiniteListComponent implements OnInit{
firstCard = {
@ -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; }