Я пытаюсь создать срез в Angular. Однако у меня проблема с передачей значений между component.ts и component.html.
Почему значения из функции "setCurrentPage" не передаются в срез?
setSearchValue($event = '') {
console.log($event);
this.searchValue=$event;
this.setCurrentPage();
}
setCurrentPage(page = 0){
this.limit = 3;
this.currentPage = page;
this.start = 0;
this.end =3;
localStorage.setItem('galleryPage', this.currentPage.toString());
}
}
<app-gallery-search *ngIf="galleries.length" [galleries]="galleries" (searchValue)="setSearchValue($event)"></app-gallery-search>
<button class="button button-small" (click)="exportGalleries()">Export galleries</button>
<button class="button button-small" (click)="removeGalleries()">Remove galleries</button>
<p *ngIf="galleries">Ilosc elementow :{{(galleries | searchGalleries : searchValue).length}} </p>
<div class="row row-align-middle" *ngIf="galleries.length">
<app-gallery-item
*ngFor="let item of galleries | searchGalleries : searchValue | slice:start:end; trackBy:item?.galleryId"
[gallery]="item"
(deleteGallery)="removeGallery($event)"
class="grid-5 grid-centered grid-15@tablet gr-15@tablet grid-15@mobile gr-15@mobile">
</app-gallery-item>