chore: copia de libs/shared con prefijo Pi y APIs de terceros actualizadas
This commit is contained in:
21
libs/ui/src/lib/util/value/directives/value.directive.ts
Normal file
21
libs/ui/src/lib/util/value/directives/value.directive.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Directive, HostBinding, Input } from '@angular/core';
|
||||
|
||||
@Directive({
|
||||
standalone: false,
|
||||
selector: '[pi-value]',
|
||||
})
|
||||
export class PiValueDirective {
|
||||
@HostBinding('class') get classes(): string | boolean {
|
||||
return ['pi-value', this.value > 0 ? 'is-positive' : 'is-negative'].join(' ');
|
||||
}
|
||||
|
||||
@Input() value!: number;
|
||||
|
||||
checkValue(): string {
|
||||
if (this.value > 0) {
|
||||
return 'is-positive';
|
||||
} else {
|
||||
return 'is-negative';
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user