DEV Community

Cover image for How to add default active property in the menu.
kallaguntaashok
kallaguntaashok

Posted on

How to add default active property in the menu.

<ul class="links">
                <li routerLinkActive="active"><i class='bx bx-news'></i><a routerLink="/Dashboard" >Dashboard</a></li>
                <li routerLinkActive="active">
                    <i class='bx bxl-slack'></i>
                    <a routerLink="/dwr">Build</a>                    
                </li>
                <li routerLinkActive="active">
                    <i class='bx bxs-chess'></i>
                    <a href="#">Master</a>
                    <i class='bx bxs-chevron-down js-arrow arrow '></i>
                    <ul class="js-sub-menu sub-menu">
                        <li><a href="#">Create Template Name</a></li>
                        <li><a href="#">Create Template schema</a></li>                        
                    </ul>
                </li>
            </ul>
Enter fullscreen mode Exit fullscreen mode

I want to keep dashboard menu item as a default active.
active property is adding up once I click on the menu link, how to set the default active property when user launch the site.

Top comments (0)