npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

angular-simple-nav-menu

v1.0.0

Published

Directives for AngularJS (version 1.x) to ease the creation of the typical navigation menu.

Downloads

3

Readme

angular-simple-nav-menu

Directives for AngularJS (version 1.x) to ease the creation of the typical navigation menu.

It is composed by 3 directives:

  1. <nav-menu>: layer that will appear and disappear.
  2. <nav-item>: layer that, when clicked, will make the <nav-menu> appear and disappear. Use it when the element must be inside the <nav-menu> layer.
  3. <nav-button>: layer that, when clicked, will make the <nav-menu> appear and disappear. Use it when the element must be outside the <nav-menu> layer.

1. Installation

1. Import the module from NPM:

~$ npm install --save angular-simple-nav-menu

2. Import the module from your AngularJS application

2.1. In your HTML:

...and after having imported the AngularJS (v.1.x):

<script src="node_modules/angular-simple-nav-menu/src/module.simple-nav-menu.js"></script>
<link   href="node_modules/angular-simple-nav-menu/src/module.simple-nav-menu.css" rel="stylesheet" type="text/css" />
2.2. In your JavaScript, when you initialize the application:
angular.module("MyApp", ["SimpleNavModule"]);

2. Usage

This is a self-explanatory example, using the directives as elements:

	<nav-button class="nav-button">Shows/Hides the navigation menu when it is clicked.</nav-button>
	<nav-menu class="nav-menu">
		<h1>Title of the navigation menu</h1>
		<nav-item>Item 1 of the navigation menu. Shows/Hides the navigation menu when it is clicked.</nav-item>
		<nav-item>Item 2 of the navigation menu. Shows/Hides the navigation menu when it is clicked.</nav-item>
		<nav-item>Item 3 of the navigation menu. Shows/Hides the navigation menu when it is clicked.</nav-item>
		<nav-item>Item 4 of the navigation menu. Shows/Hides the navigation menu when it is clicked.</nav-item>
	</nav-menu>

You only need to know that:

  • The directives can be used as attributes too.

  • The width of the .nav-menu is set to 250px in the css file. Override it from other stylesheet, or directly from the source file if you need to adapt it to other dimensions.

  • The only 2 CSS rules applied are: .nav-menu--inner--api and .nav-menu--inner--api.activated. The CSS file is less than 10 lines, so you can modify it, but it should not be necessary, except for the width of the <nav-menu>.

3. Test

Currently, there are no test for this project.

However, you can open a very simple example if you go to: test/simple-example.html

It is important that your browser lets you load files from external CDN and from other (upper) paths for it to work. If so, you will be able to run the example okay.

4. Conclusion

Use this library as you like, this is a very simple module that can ease a bit the typical navigation menu for an AngularJS application.