angular2-useful-swiper
angular2-useful-swiper copied to clipboard
Filter the Swipper from Json object
Hello, i have a swipper build with an object like that
export const SystemsItems = [
{
name: 'Panasonic 3DO',
date: '1993',
picture: 'assets/systems/3do/bg.jpg',
developer: 'nintendo'
},
{
name: 'Aamber Pegasus',
date: '1981',
picture: 'assets/systems/pegasus/bg.jpg',
developer: 'nintendo'
},
{
name: 'Acclaim',
picture: 'assets/systems/acclaim/bg.jpg',
developer: 'sony'
}
]
And this is my html
<swiper #usefulSwiper [config]="config" class="swipper-retrobox" [initialize]="panel">
<div class="swiper-wrapper">
<div *ngFor="let system of SystemsItemsFiltered" class="swiper-slide" [attr.developer]="system.developer">
<a class="angled-img">
<span class="img">
<img [src]="'../../'+system.picture" alt="">
</span>
<span class="over-info">
<span>
<span>
{{ system.name }}<span *ngIf="system.date" class="date">{{ system.date }}</span>
</span>
</span>
</span>
</a>
</div>
</div>
<div class="swipper-deco">
<div class="deco-left"></div>
<div class="deco-right"></div>
</div>
</swiper>
i want filter the Swipper slide when i change the my JSon. My filter fonction works, but i have no idea of how can i relaunch my Swipper.
I have try the update function without success I have try to destroy my Swipper but i have no idea of how can i rebuild it.
Please can you help me?
Okay finaly the update function works, but when the loop option is set to true and when I'm at the end of the swipper my filter doesen't work