valor-software/angular2-bootstrap

View on GitHub
demo/src/app/components/+alerts/demos/config/config.ts

Summary

Maintainability
A
35 mins
Test Coverage
import { Component } from '@angular/core';
import { AlertConfig } from 'ngx-bootstrap/alert';

// such override allows to keep some initial values

export function getAlertConfig(): AlertConfig {
  return Object.assign(new AlertConfig(), { type: 'success' });
}

@Component({
  selector: 'demo-alert-config',
  templateUrl: './config.html',
  providers: [{ provide: AlertConfig, useFactory: getAlertConfig }]
})
export class DemoAlertConfigComponent {}