ng2-bootstrap
Version:
angular2 bootstrap components
53 lines (45 loc) • 1.96 kB
Markdown
### Usage
```typescript
import { CarouselModule } from 'ng2-bootstrap/ng2-bootstrap';
// or
import { CarouselModule } from 'ng2-bootstrap/components/carousel';
```
### Annotations
```typescript
// class Carousel implements OnDestroy
({
selector: 'carousel'
})
export class CarouselComponent implements OnDestroy {
() public noWrap:boolean;
() public noPause:boolean;
() public noTransition:boolean;
() public get interval():number {}
}
// class Slide implements OnInit, OnDestroy
({
selector: 'slide'
})
export class SlideComponent implements OnInit, OnDestroy {
() public index:number;
() public direction:Direction;
('class.active')
() public active:boolean;
('class.item')
('class.carousel-item')
public addClass:boolean = true;
}
```
### Carousel properties
- `interval` (`?number=5000`) - amount of time in milliseconds to delay between automatically cycling an item. If `false`, carousel will not automatically cycle
- `noTransition` (`?boolean=false`) - if `true` will disable transitions on the carousel
- `noPause` (`?boolean=false`) - if `true` will disable pausing on carousel mouse hover
- `noWrap` (`?boolean=false`) - if `true` the carousel will not cycle continuously and will have hard stops (prevent looping)
- `pause` (*not yet supported*) (`?string='hover'`) - event group name which pauses the cycling of the carousel, if `hover` pauses on mouseenter and resumes on mouseleave
- `keyboard` (*not yet supported*) (`?boolean=true`) - if `false` carousel will not react to keyboard events
- *note*: swiping not yet supported
### Slide properties
- `active` (`?boolean=false`) - currently active slide
- `index` (`?number`) - index of slide in carousel's slides
- `direction` (`?string`) (*not yet supported*)
- `actual` (*not yet supported*) (`?any`) - will be bind to slider context, to be used from template