Skip to content

Commit

Permalink
Merge branch 'master' into Swiper7
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Aug 18, 2021
2 parents 26d4c4b + fa93ee8 commit e641fd2
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/swiper_angular_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ body:
id: qa
attributes:
label: Check that this is really a bug
description: For Q&A open a [GitHub Discussion](https://github.com/nolimits4web/swiper/discussions) or join our [Discord Chat Server](https://discord.gg/BUpd4UTkgj)
description: For Q&A open a [GitHub Discussion](https://github.com/nolimits4web/swiper/discussions)
options:
- label: I confirm
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/swiper_core_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ body:
id: qa
attributes:
label: Check that this is really a bug
description: For Q&A open a [GitHub Discussion](https://github.com/nolimits4web/swiper/discussions) or join our [Discord Chat Server](https://discord.gg/BUpd4UTkgj)
description: For Q&A open a [GitHub Discussion](https://github.com/nolimits4web/swiper/discussions)
options:
- label: I confirm
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/swiper_react_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ body:
id: qa
attributes:
label: Check that this is really a bug
description: For Q&A open a [GitHub Discussion](https://github.com/nolimits4web/swiper/discussions) or join our [Discord Chat Server](https://discord.gg/BUpd4UTkgj)
description: For Q&A open a [GitHub Discussion](https://github.com/nolimits4web/swiper/discussions)
options:
- label: I confirm
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/swiper_svelte_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ body:
id: qa
attributes:
label: Check that this is really a bug
description: For Q&A open a [GitHub Discussion](https://github.com/nolimits4web/swiper/discussions) or join our [Discord Chat Server](https://discord.gg/BUpd4UTkgj)
description: For Q&A open a [GitHub Discussion](https://github.com/nolimits4web/swiper/discussions)
options:
- label: I confirm
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/vue_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ body:
id: qa
attributes:
label: Check that this is really a bug
description: For Q&A open a [GitHub Discussion](https://github.com/nolimits4web/swiper/discussions) or join our [Discord Chat Server](https://discord.gg/BUpd4UTkgj)
description: For Q&A open a [GitHub Discussion](https://github.com/nolimits4web/swiper/discussions)
options:
- label: I confirm
required: true
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,6 @@ Swiper is not compatible with all platforms, it is a modern touch slider which i

The Swiper community can be found on [GitHub Discussions](https://github.com/nolimits4web/swiper/discussions), where you can ask questions, voice ideas, and share your projects

To chat with other community members you can join the [Swiper Discord](https://discord.gg/BUpd4UTkgj)

Our [Code of Conduct](https://github.com/nolimits4web/swiper/blob/master/CODE_OF_CONDUCT.md) applies to all Swiper community channels.

## Dist / Build
Expand Down
5 changes: 5 additions & 0 deletions playground/angular/src/app/home/home.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<main>
<div>
<h4>Slide change</h4>
<swiper direction="horizontal" (slideChange)="onSlideChange($event)">
<ng-template *ngFor="let item of slidesEx" swiperSlide> {{ item }} </ng-template>
</swiper>
{{ slidesEx | json }}
<h4>Nested</h4>
<swiper direction="horizontal">
<ng-container *ngFor="let item of [].constructor(4); let i = index">
Expand Down
16 changes: 14 additions & 2 deletions playground/angular/src/app/home/home.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChangeDetectorRef, Component, ViewChild } from '@angular/core';
import { ChangeDetectorRef, Component, NgZone, ViewChild } from '@angular/core';
import { BehaviorSubject } from 'rxjs';
import { SwiperComponent } from 'src/angular/src/public-api';
import SwiperCore, {
Expand Down Expand Up @@ -35,7 +35,7 @@ export class HomePage {
show: boolean;
thumbs: any;
slides$ = new BehaviorSubject<string[]>(['']);
constructor(private cd: ChangeDetectorRef) {}
constructor(private cd: ChangeDetectorRef, private ngZone: NgZone) {}
ngOnInit() {}

getSlides() {
Expand Down Expand Up @@ -104,4 +104,16 @@ export class HomePage {
1024: { slidesPerView: this.breakPointsToggle ? 7 : 5, spaceBetween: 50 },
};
}

slidesEx = ['first', 'second'];

onSlideChange(swiper) {
if (swiper.isEnd) {
// all swiper events are run outside of ngzone, so use ngzone.run or detectChanges to update the view.
this.ngZone.run(() => {
this.slidesEx = [...this.slidesEx, `added ${this.slidesEx.length - 1}`];
});
console.log(this.slidesEx);
}
}
}

0 comments on commit e641fd2

Please sign in to comment.