Skip to content

Commit

Permalink
feat(angular): support id input
Browse files Browse the repository at this point in the history
  • Loading branch information
vltansky committed Apr 28, 2021
1 parent 434a19c commit ad51e32
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions playground/angular/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
[centeredSlides]="true"
navigation
class="mySwiper"
id="mySwiperID"
>
<ng-template swiperSlide *ngFor="let slide of virtualSlides; index as i"
>Slide {{ slide }}</ng-template
Expand Down
6 changes: 5 additions & 1 deletion playground/angular/src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@

.mySwiper {
background: #ccc;
padding: 2 0px 0;
padding: 30px 0;
}

#mySwiperID {
border: 1px solid red;
}
2 changes: 1 addition & 1 deletion src/angular/src/swiper.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</ng-container>
<div *ngIf="scrollbar && showScrollbar" class="swiper-scrollbar" #scrollbarElRef></div>
<div *ngIf="pagination && showPagination" class="swiper-pagination" #paginationElRef></div>
<div [ngClass]="[wrapperClass, class].join(' ')">
<div [ngClass]="[wrapperClass, class].join(' ')" [attr.id]="id">
<ng-content select="[slot=wrapper-start]"></ng-content>
<ng-template
*ngTemplateOutlet="
Expand Down
1 change: 1 addition & 0 deletions src/angular/src/swiper.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ export class SwiperComponent implements OnInit {
@Input() thumbs: SwiperOptions['thumbs'];
@Input() zoom: SwiperOptions['zoom'];
@Input() class: string;
@Input() id: string;
@Input()
set navigation(val) {
const currentNext = typeof this._navigation !== 'boolean' ? this._navigation?.nextEl : null;
Expand Down

0 comments on commit ad51e32

Please sign in to comment.