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": { "@angular-eslint/schematics:library": {
"setParserOptionsProject": true "setParserOptionsProject": true
} }
},
"cli": {
"analytics": "bc1499f9-0bc1-4ae6-ab35-867275a6a90f"
} }
} }

View file

@ -16,7 +16,7 @@
</nb-card> </nb-card>
</div> </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>
<nb-card-header>Window Scroll</nb-card-header> <nb-card-header>Window Scroll</nb-card-header>
<nb-list <nb-list

View file

@ -1,4 +1,4 @@
import { Component } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { NewsService } from '../news.service'; import { NewsService } from '../news.service';
@Component({ @Component({
@ -6,7 +6,7 @@ import { NewsService } from '../news.service';
templateUrl: 'infinite-list.component.html', templateUrl: 'infinite-list.component.html',
styleUrls: ['infinite-list.component.scss'], styleUrls: ['infinite-list.component.scss'],
}) })
export class InfiniteListComponent { export class InfiniteListComponent implements OnInit{
firstCard = { firstCard = {
@ -24,7 +24,10 @@ export class InfiniteListComponent {
pageSize = 10; pageSize = 10;
constructor(private newsService: NewsService) {} constructor(private newsService: NewsService) {}
ngOnInit() {
this.loadNext(this.firstCard);
this.loadNext(this.secondCard);
}
loadNext(cardData) { loadNext(cardData) {
if (cardData.loading) { return; } if (cardData.loading) { return; }