Angular 18 PrimeNG: Toggle for Light and Dark PrimeNG themes. Without services!

Опубликовано: 06 Февраль 2026
на канале: Natalia Frontend
1,355
27

🎥 In this tutorial, I’ll show you how to create a dark/light theme switcher (🌞 light / 🌜 dark) in Angular 18 without using services! We’re using 🛠️ Renderer2 to toggle the application theme between lara-light-indigo and lara-dark-indigo from the PrimeNG library. The switch is quick and easy, and all the code is written directly in the components – perfect for a fast project or theme experimentation. Watch now to learn how! 🚀

========================================

🎥 W tym filmie pokażę, jak stworzyć przełącznik motywów (🌞 light / 🌜 dark) w Angular 18, bez użycia serwisów! Korzystamy z 🛠️ Renderer2, aby zmienić motyw aplikacji pomiędzy lara-light-indigo i lara-dark-indigo z biblioteki PrimeNG. Przełączanie jest proste i szybkie, a cały kod piszemy bezpośrednio w komponentach – idealne na szybki projekt lub eksperyment z motywami. Zapraszam do obejrzenia! 🚀