Friday, July 18, 2025

How to Highlight a Link of Side Nav When It Has Multiple Child Links in Angular

🔗 How to Highlight a Link When It Has Multiple Child Links in Angular

When building a sidebar in Angular, you might want to highlight a parent link when any of its child routes are active. Angular’s routerLinkActive only works for single routes — so here’s a quick 2-step solution using a custom directive.

  1. Step 1: Create a custom directive
    Write a directive that checks the current URL against a list of child links and adds an active class if any match.

Step 1: Directive Code

  1. Step 2: Use it in your template
    On your parent menu link, pass the list of child URLs to the directive.

Step 2: Template Code

✅ Works with multiple child links, query parameters, and is easy to reuse.

✅ This blog is written by TechJourney with Gagan, sharing practical Angular tips for developers.

Tuesday, July 1, 2025

Create Search Functionality using 2 steps using pipe in Angular

To Implement Search Functionality without writing code in ts file

Step1: Create a Pipe using below code.

Code Of Search Filter Pipe



Step2: write below code where you want to implement search like in drop down.

Code Snippet



In above code we use just
<input matInput  placeholder="Search Company" #searchInput /><br> 
based on referece variable we took input and pass to pipe | searchByFilter:searchInput.value:'organizationName'"

How to Do Cross-Browser Testing on Windows — Including Safari via Playwright

To test follow few steps: Step 1. Install node Step 2. create Folder and run these commands commands Copy Code ...