Tech Lead: Daniel Henricks 2/10/2026
This project demonstrates several modern Angular features:
- The application is built using a Standalone Component (
standalone: true). - This removes the need for
NgModule, making the application structure simpler and more lightweight. - We import necessary dependencies (like
CommonModule) directly into the component.
- We use Signals for state management, which is the modern standard for reactivity in Angular.
signal(): Used to create reactive state variables (e.g.,noClickCount,yesButtonHeight).- Signal Updates: We update state using methods like
.update()(e.g., increasing the "No" click count) and.set()(e.g., changing the final state). - Template Reading: We read signal values in the template by calling them as functions (e.g.,
yesButtonHeight()).
- Interpolation (
{{ }}): Displaying dynamic text like the question or button labels. - Property Binding (
[]):- Binding to image sources (
[src]) and alt text ([alt]). - Binding to CSS classes (
[class.hidden]) to conditionally show or hide elements.
- Binding to image sources (
- Style Binding: Dynamically changing styles based on state (e.g.,
[style.height.px]and[style.fontSize.px]to make the "Yes" button grow). - Event Binding (
()): Handling user interactions like clicks ((click)="handleYesClick()").
- The component uses TypeScript getters (e.g.,
get currentImageSrc()) to derive values based on the current state of the signals. - This keeps the template clean by moving logic into the TypeScript class.
src/app/app.ts: The main logic, state management (Signals), and event handlers.src/app/app.html: The structure and layout, utilizing Angular's template syntax.src/app/app.css: Global styles and Tailwind utility classes (if configured).
- Install Dependencies:
npm install @angular/cli && npm install - Run the App:
ng serve