Skip to content

Commit ad51e32

Browse files
committed
feat(angular): support id input
1 parent 434a19c commit ad51e32

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

playground/angular/src/app/app.component.html

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
[centeredSlides]="true"
1111
navigation
1212
class="mySwiper"
13+
id="mySwiperID"
1314
>
1415
<ng-template swiperSlide *ngFor="let slide of virtualSlides; index as i"
1516
>Slide {{ slide }}</ng-template

playground/angular/src/app/app.component.scss

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,9 @@
44

55
.mySwiper {
66
background: #ccc;
7-
padding: 2 0px 0;
7+
padding: 30px 0;
8+
}
9+
10+
#mySwiperID {
11+
border: 1px solid red;
812
}

src/angular/src/swiper.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</ng-container>
66
<div *ngIf="scrollbar && showScrollbar" class="swiper-scrollbar" #scrollbarElRef></div>
77
<div *ngIf="pagination && showPagination" class="swiper-pagination" #paginationElRef></div>
8-
<div [ngClass]="[wrapperClass, class].join(' ')">
8+
<div [ngClass]="[wrapperClass, class].join(' ')" [attr.id]="id">
99
<ng-content select="[slot=wrapper-start]"></ng-content>
1010
<ng-template
1111
*ngTemplateOutlet="

src/angular/src/swiper.component.ts

+1
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ export class SwiperComponent implements OnInit {
162162
@Input() thumbs: SwiperOptions['thumbs'];
163163
@Input() zoom: SwiperOptions['zoom'];
164164
@Input() class: string;
165+
@Input() id: string;
165166
@Input()
166167
set navigation(val) {
167168
const currentNext = typeof this._navigation !== 'boolean' ? this._navigation?.nextEl : null;

0 commit comments

Comments
 (0)