O'Reilly logo

AngularJS Directives Cookbook by Fernando Monteiro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building a navbar directive

One of the interface components most commonly used on websites and web applications are navigation menus. Although they are very simple, they are also very useful in any type of application.

Getting ready

Let's build the basis for an AngularJS application. As we mentioned before, we use the Yeoman generator: generator-angm.

Tip

You must have Node.js, Yeoman, Bower, and Grunt already installed on your machine.

Open your Terminal window and type the following commands in the order they appear:

  1. To install the generator, use the following command:
    npm install generator-angm -g
    
  2. To create the application, use the following command:
    yo angm
    
  3. To create the modules, use the following command:
    yo angm:angm-module
    
  4. Use the name about ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required