---
title: "Navigation Menu in Angular JS"  
description: "In this blog, I’m explaining how to create a navigation menu using angular js.Step 1First create an empty asp.net application and add a web form named"  
author: "Sumit Kesarwani"  
published: 2014-03-15  
updated: 2014-09-18  
canonical: https://www.mindstick.com/blog/660/navigation-menu-in-angular-js  
category: "angular js"  
tags: ["single page app", "angular js"]  
reading_time: 2 minutes  

---

# Navigation Menu in Angular JS

In this blog, I’m explaining how to create a [navigation menu](https://www.mindstick.com/forum/158677/how-can-create-a-responsive-navigation-menu-that-adapts-to-different-screen-sizes) using [angular js](https://www.mindstick.com/forum/33800/how-to-add-edit-update-record-in-angular-js-in-mvc).

Step 1

First create an empty [asp.net application](https://www.mindstick.com/forum/540/using-stored-procedures-with-entity-framework-in-an-asp-dot-net-application) and add a web form named ”Default.aspx” to it.

Now add “angular.min.js” file to [your project](https://www.mindstick.com/forum/156583/best-way-to-link-bootstrap-file-in-your-project) because this file is necessary for working with angular js.

##### Step 2

Now add “angular.min.js” file to your head section of [your page](https://answers.mindstick.com/qa/32580/how-do-you-pay-facebook-to-help-boost-your-page) by drag-n-drop from the solution [explorer](https://www.mindstick.com/forum/34658/want-to-developed-windows-explorer-without-using-telerik) like this:

```
<head runat="server">    <title>Navigation Menu</title>    <script src="angular.min.js"></script></head>
```

##### Step 3

Next add the ng-app [attribute](https://www.mindstick.com/blog/221/attributes-reflection) to the body tag:

<body ng-app>

By defining the ng-app attribute in the body tag, it denotes that the angular will active on whole body tag. If you want to enable angular for whole html page, put it in [html tag](https://www.mindstick.com/forum/78/how-avoid-the-html-tag-and-remove-the-formating-of-copy-in-ajax-editor).

##### Step 4

Now write the following code in the body section of the webpage:

```
<nav class="{{active}}" ng-click="$event.preventDefault()">        <a href="#" class="home" ng-click="active='home'">Home</a>        <a href="#" class="services" ng-click="active='services'">Services</a>        <a href="#" class="products" ng-click="active='products'">Products</a>        <a href="#" class="contactUs" ng-click="active='contactUs'">Contact Us</a>    </nav>    <p ng-hide="active">Please click on a menu item</p>    <p ng-show="active">You Choose:<b>{{active}}</b></p>
```

And also add the following style tag in the head section:

```
<style>        * {            margin: 0;            padding: 0;        }        body {            margin: 0 auto;            text-align: center;        }        nav {            display: inline-block;            margin: 60px auto 45px;            background-color: #17c5ed;            border-radius: 2px;            box-shadow: 0px 1px 1px #ccc;        }            nav a {                display: inline-block;                font-size: 16px;                padding: 18px 30px;                text-decoration: none !important;                line-height: 1;                text-transform: uppercase;                font-weight: bold;                color: black!important;                background-color: transparent;                transition: background-color 0.25s;            }            nav.home .home,            nav.products .products,            nav.services .services,            nav.contactUs .contactUs {                background-color: #e35885;            }        p {            font-size: 22px;            font-weight: bold;            color: #7d9098;        }            p b {                color: #ffffff;                display: inline-block;                padding: 5px 10px;                background-color: #c4d7e0;                border-radius: 2px;                text-transform: uppercase;                font-size: 18px;            }    </style>
```

##### Output

![Navigation Menu in Angular JS](https://www.mindstick.com/blogs/913b2d96-531a-4381-8ca9-599d4a66a916/images/18163f05-8653-4da1-9629-5880af36a936.png)\
\
![Navigation Menu in Angular JS](https://www.mindstick.com/blogs/913b2d96-531a-4381-8ca9-599d4a66a916/images/c6ff2dfc-c839-4bac-a49b-83dd99c7e586.png)

---

Original Source: https://www.mindstick.com/blog/660/navigation-menu-in-angular-js

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
