Skip to content

Instantly share code, notes, and snippets.

@workfel
Last active October 31, 2018 19:58
Show Gist options
  • Save workfel/14c1efca0d466779130f3d6dd7f12322 to your computer and use it in GitHub Desktop.
Save workfel/14c1efca0d466779130f3d6dd7f12322 to your computer and use it in GitHub Desktop.
Create angular library in your private npm registry on AzureDevOps  [ BADGE COMPONENT ] 
.badge{
width : fit-content;
padding: 4px;
border-radius: 30px;
}
.badge-success {
background: green;
}
.badge-error {
background: red;
}
.badge-warn {
background: orange;
}
<div class="badge badge-{{color}}">
{{label}}
</div>
import { Component, OnInit, Input } from '@angular/core';
export type ColorType = 'warn' | 'success' | 'error';
@Component({
selector: 'lib-badge',
templateUrl: './badge.component.html',
styleUrls: ['./badge.component.css']
})
export class BadgeComponent implements OnInit {
@Input() label: string;
@Input() color: ColorType;
constructor() { }
ngOnInit() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment