7
7
< c-card-body >
8
8
< p class ="text-body-secondary small "> Here’s a carousel with slides</ p >
9
9
< app-docs-example href ="components/carousel ">
10
- < c-carousel (itemChange) ="onItemChange($event) " [interval] ="7000 " transition =" slide " >
10
+ < c-carousel (itemChange) ="onItemChange($event) " [interval] ="7000 ">
11
11
< c-carousel-inner >
12
12
@for (slide of slides[0]; track slide.src) {
13
13
< c-carousel-item >
35
35
Adding in the previous and next controls with < code > c-carousel-controls</ code > component.
36
36
</ p >
37
37
< app-docs-example href ="components/carousel/#with-controls ">
38
- < c-carousel (itemChange) ="onItemChange($event) " [interval] ="0 ">
39
- < c-carousel-inner >
40
- @for (slide of slides[0]; track slide.src) {
41
- < c-carousel-item >
38
+ < c-carousel (itemChange) ="onItemChange($event) " [interval] ="0 " aria-roledescription =" carousel " aria-label =" CoreUI Angular Carousel Example " >
39
+ < c-carousel-inner id =" carousel-items " >
40
+ @for (slide of slides[0]; track slide.src; let i = $index ) {
41
+ < c-carousel-item aria-roledescription =" slide " [attr.aria-label] =" (i + 1).toString() + ' of '+ slides[0].length " >
42
42
< img
43
43
[src] ="slide.src "
44
44
alt ="{{slide.title}} "
48
48
</ c-carousel-item >
49
49
}
50
50
</ c-carousel-inner >
51
- < c-carousel-control caption ="Previous " direction ="prev " i18n-caption />
52
- < c-carousel-control caption ="Next " direction ="next " i18n-caption />
51
+ < c-carousel-control caption ="Previous " direction ="prev " i18n-caption aria-controls =" carousel-items " aria-label =" Previous Slide " />
52
+ < c-carousel-control caption ="Next " direction ="next " i18n-caption aria-controls =" carousel-items " aria-label =" Next Slide " />
53
53
</ c-carousel >
54
54
</ app-docs-example >
55
55
</ c-card-body >
102
102
</ p >
103
103
< app-docs-example href ="components/carousel/#with-indicators ">
104
104
< c-carousel (itemChange) ="onItemChange($event) " [activeIndex] ="1 " [dark] ="true " [interval] ="5000 " direction ="prev ">
105
- < c-carousel-indicators #indicators ="cCarouselIndicators ">
106
- < ng-template cTemplateId ="carouselIndicatorsTemplate ">
107
- @for (slide of slides[1]; track slide; let i = $index) {
108
- < button
109
- [attr.data-coreui-target] ="i "
110
- type ="button "
111
- (click) ="indicators.onClick(i) "
112
- [class] ="{ active: indicators.active === i, border: '1px' } "
113
- [attr.aria-current] ="indicators.active === i ">
114
- < img
115
- [src] ="slide.src "
116
- alt ="{{slide.title}} "
117
- class ="d-flex w-100 "
118
- loading ="lazy "
119
- />
120
- </ button >
121
- }
122
- </ ng-template >
123
- </ c-carousel-indicators >
105
+ < c-carousel-indicators />
106
+ <!-- <c-carousel-indicators #indicators="cCarouselIndicators">-->
107
+ <!-- <ng-template cTemplateId="carouselIndicatorsTemplate">-->
108
+ <!-- @for (slide of slides[1]; track slide; let i = $index) {-->
109
+ <!-- <button-->
110
+ <!-- [attr.data-coreui-target]="i"-->
111
+ <!-- type="button"-->
112
+ <!-- (click)="indicators.onClick(i)"-->
113
+ <!-- [class]="{ active: indicators.active === i, border: '1px' }"-->
114
+ <!-- [attr.aria-current]="indicators.active === i">-->
115
+ <!-- <img-->
116
+ <!-- [src]="slide.src"-->
117
+ <!-- alt="{{slide.title}}"-->
118
+ <!-- class="d-flex w-100"-->
119
+ <!-- loading="lazy"-->
120
+ <!-- />-->
121
+ <!-- </button>-->
122
+ <!-- }-->
123
+ <!-- </ng-template>-->
124
+ <!-- </c-carousel-indicators>-->
124
125
< c-carousel-inner >
125
126
@for (slide of slides[0]; track slide.src) {
126
127
< c-carousel-item >
@@ -189,7 +190,7 @@ <h3>{{ slide.title }}</h3>
189
190
with a fade transition instead of a slide.
190
191
</ p >
191
192
< app-docs-example href ="components/carousel/#crossfade ">
192
- < c-carousel (itemChange) ="onItemChange($event) " [animate] =" false " [ interval] ="5000 " transition ="crossfade ">
193
+ < c-carousel (itemChange) ="onItemChange($event) " [interval] ="interval() " transition ="crossfade ">
193
194
< c-carousel-inner >
194
195
@for (slide of slides[0]; track slide.src) {
195
196
< c-carousel-item >
@@ -208,6 +209,9 @@ <h3>{{ slide.title }}</h3>
208
209
< c-carousel-control caption ="Previous " direction ="prev " i18n-caption />
209
210
< c-carousel-control caption ="Next " direction ="next " i18n-caption />
210
211
</ c-carousel >
212
+ < hr >
213
+ < button cButton (click) ="toggleInterval() "> Toggle interval</ button >
214
+ {{ interval() }}
211
215
</ app-docs-example >
212
216
</ c-card-body >
213
217
</ c-card >
0 commit comments