feat: counter

This commit is contained in:
2025-12-14 20:26:25 -03:00
parent 6732e0b974
commit 57f721f85a
4 changed files with 55 additions and 0 deletions

View File

@@ -0,0 +1 @@
<p class="total-elements"><span>{{count()}}</span> {{item()|upperfirst}}</p>

View File

@@ -0,0 +1,17 @@
:host {
display: inline-block;
width: 100%;
}
.total-elements {
font-family: var(--secondaryFont);
margin: 2rem 0;
text-align: center;
color: var(--primary);
font-size: 2rem;
& span {
font-size: 3rem;
font-weight: 900;
}
}

View File

@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { Counter } from './counter';
import { UpperfirstPipe } from '../../pipes/upperfirst-pipe';
describe('Counter', () => {
let component: Counter;
let fixture: ComponentFixture<Counter>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [Counter, UpperfirstPipe]
})
.compileComponents();
fixture = TestBed.createComponent(Counter);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,13 @@
import { Component, input } from '@angular/core';
import { UpperfirstPipe } from "../../pipes/upperfirst-pipe";
@Component({
selector: 'app-counter',
imports: [UpperfirstPipe],
templateUrl: './counter.html',
styleUrl: './counter.scss',
})
export class Counter {
item = input('');
count = input(0);
}