import { bootstrapApplication } from '@angular/platform-browser';
import { Component, Injectable, signal, inject } from '@angular/core';
@Injectable({ providedIn: 'root' })
class CounterStore {
count = signal(0);
inc() { this.count.update(n => n + 1); }
}
@Component({
selector: 'app-root',
standalone: true,
template: `
<h3>Service with Signals</h3>
<p>Count: {{ store.count() }}</p>
<button (click)="store.inc()">Increment</button>
`
})
class App { store = inject(CounterStore); }
bootstrapApplication(App);