Closed ptu14 closed 3 weeks ago
This PR simplifies the Angular counter component, improving its readability and code formatting while maintaining its core functionality.
Component Structure Simplification
Template Cleanup
Code Formatting
import { Component } from '@angular/core' import { injectSelector, injectDispatch } from "@reduxjs/angular-redux"; import { decrement, increment } from './store/counter-slice' import { RootState } from './store' @Component({ selector: 'app-root', standalone: true, template: ` <button (click)="dispatch(increment())"> Increment </button> <span>{{ count() }}</span> <button (click)="dispatch(decrement())"> Decrement </button> ` }) export class AppComponent { count = injectSelector((state: RootState) => state.counter.value) dispatch = injectDispatch() increment = increment decrement = decrement }
Simplify and Improve Angular Counter Component
Overview
This PR simplifies the Angular counter component, improving its readability and code formatting while maintaining its core functionality.
Changes Made
Component Structure Simplification
Template Cleanup
Code Formatting
Example of Updated Component