Premium

Like Button (Facebook-style Toggle)

By FrontendAtlas Editorial · Updated Nov 11, 2026

Challenge summary

Create a Like button with toggle state and a counter in Angular. Clicking should increment on like, decrement on unlike, and never allow the count to drop below zero.

What you'll practice

  • Use a standalone Angular component as the root component.
  • Render a Like button with an icon, label, and a like count.
  • Update the button visual style based on liked state.
  • Second click: becomes unliked, count decreases by 1, button returns to normal.
  • The template should reflect state immediately and apply an active class when liked.

What Premium unlocks

Premium unlocks the runnable workspace, behavioral checks, implementation walkthrough, and edge-case discussion. It also runs as an Interview Pressure Mode, in rounds that add requirements the way an interviewer does.

Free related practice

Upgrade to FrontendAtlas Premium to unlock this challenge. Already upgraded? Sign in to continue.

Premium is $24 a month or $99 a year, less in many countries.