ng2-bootstrap
Version:
angular2 bootstrap components
32 lines (27 loc) • 1.02 kB
Markdown
### Usage
```typescript
import { AlertModule } from 'ng2-bootstrap/ng2-bootstrap';
// or
import { AlertModule } from 'ng2-bootstrap/components/alert';
```
### Annotations
```typescript
// class Alert
export class AlertComponent implements OnInit {
public type:string = 'warning';
public dismissible:boolean;
public dismissOnTimeout:number;
public close:EventEmitter<Alert> = new EventEmitter(false);
}
```
### Alert properties
- `type` (`?:string='warning'`) - provide one of the four supported contextual classes:
`success`,`info`, `warning`, `danger`
- `dismissible` (`?:boolean=false`) - determines if an inline close button is displayed
- `dismissOnTimeout` (`?number=0`) - number of milliseconds, if specified sets a timeout duration, after which the alert will be closed
### Alert events
- `close` - fired when `alert` closed with inline button or by timeout, `$event` is an instance of `Alert` component