Complete the code to import the Angular service for simple state management.
import { [1] } from '@angular/core';
The @Injectable decorator is used to create services for simple state management without NgRx.
Complete the code to create a simple state variable in the service.
export class CounterService { count = [1]; }
We initialize the count with 0 as a number, not a string or null.
Fix the error in the method that increments the count.
increment() {
this.count [1] 1;
}The += operator adds 1 to the current count value.
Fill both blanks to create a simple Angular component that uses the service.
constructor(private [1]: [2]) {}
The constructor injects the service using a variable name and its class type.
Fill all three blanks to update the template to show count and a button to increment.
<p>Count: {{ [1].[2] }}</p>
<button (click)="[3]()">Increment</button>The template accesses the service variable and method via the injected variable name.
