import {ChangeDetectionStrategy, Component, Input} from '@angular/core'; const BADGES = { 'Directive': 'success', 'Component': 'success', 'Service': 'primary', 'Configuration': 'primary', 'Class': 'danger', 'Interface': 'danger' }; @Component({ selector: 'ngbd-api-docs-badge', template: `
Deprecated {{ deprecated.version }} Since {{ since.version }} {{text}}
`, changeDetection: ChangeDetectionStrategy.OnPush }) export class NgbdApiDocsBadge { badgeClass; text; @Input() deprecated: {version: string}; @Input() since: {version: string}; @Input() set type(type: string) { this.text = type; this.badgeClass = `badge-${BADGES[type] || 'secondary'}`; } }