Last active
October 31, 2018 19:58
-
-
Save workfel/14c1efca0d466779130f3d6dd7f12322 to your computer and use it in GitHub Desktop.
Create angular library in your private npm registry on AzureDevOps [ BADGE COMPONENT ]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.badge{ | |
width : fit-content; | |
padding: 4px; | |
border-radius: 30px; | |
} | |
.badge-success { | |
background: green; | |
} | |
.badge-error { | |
background: red; | |
} | |
.badge-warn { | |
background: orange; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="badge badge-{{color}}"> | |
{{label}} | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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