# angular-plugin

> a few helper classes to make UIs more pluggable.

Latest version **0.0.26** (published 2018-02-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install angular-plugin
pnpm add angular-plugin
yarn add angular-plugin
bun add angular-plugin
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.26 |
| Published | 2018-02-08 |
| First published | 2017-02-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 15.1 KB |
| Known vulnerabilities | 0 (+12 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | rmalchow |

## Links

- npm: https://www.npmjs.com/package/angular-plugin
- Repository: https://github.com/rmalchow/angular-plugin
- Homepage: https://github.com/rmalchow/angular-plugin#readme
- Issues: https://github.com/rmalchow/angular-plugin/issues
- npm.io page: https://npm.io/package/angular-plugin

## Dependencies (2)

- [angular](https://npm.io/package/angular.md) 1.6.1
- [angular-route](https://npm.io/package/angular-route.md) 1.6.1

## Recent versions

- 0.0.26 (latest) — 2018-02-08
- 0.0.25 — 2018-02-08
- 0.0.24 — 2017-08-31
- 0.0.23 — 2017-07-17
- 0.0.22 — 2017-07-17
- 0.0.21 — 2017-07-17
- 0.0.20 — 2017-07-13
- 0.0.19 — 2017-07-13
- 0.0.18 — 2017-07-05
- 0.0.16 — 2017-07-05
- 0.0.15 — 2017-07-05
- 0.0.14 — 2017-07-05
- 0.0.13 — 2017-07-05
- 0.0.10 — 2017-06-22
- 0.0.9 — 2017-06-22
- … 7 more at https://npm.io/package/angular-plugin/versions

## README

a few helper classes to make UIs more pluggable.

the first relevant component is the PluginMenuService, which 
has the method that is probably the most interesting one:

	PluginMenuService.addItem(PATH,NAME,ITEM);
	
for example:

	PluginMenuService.addItem(
		"/main",
		"/users",
		{
			"title" : "Users",
			"id" : "USERS", // default is same as title
			"controller", "UserListController",
			"controllerAs", "ctrl",
			"templateUrl", "userlist.html",
			// special configs:
			"visible" : true,   // this is used by the directives to automatically show/hide items
			"active" : true,   // this is true if $route.beginsWith($PATH+$NAME)
			"order" : 1,   // children are sorted by this
		}
	);
	
you can add anything you want and then use it in your rendering. two directives can help with 
rendering:

	<div include-components="/main"> 
	</div>
	
will iterate all components directly under "/main" (not recursively) and create a copy of the element 
the attribute is on for each item found. these are also automatically hidden and shown according to the 
value of the visible key.

	<ul>	 
		<li menu-items="/main">
			<a href="#{{item.path}}">{{item.title}}</a>
			<ul>
				<li menu-items="{{item.path}}">
					<a href="#{{item.path}}">{{item.title}}</a>
				</li>
			</ul>	
		</li>
	</ul>	
			
			
this is similar to include components, except that it only iterates and puts the current item on the scope. 
it has to be rendered manually. this example would do two levels.

---
_Source: https://npm.io/package/angular-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
