khollenbeck-angular-navigation
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -26,2 +26,25 @@ import { Component, Input, HostBinding } from '@angular/core'; | ||
} | ||
public onItemClicked(event: any) { | ||
const currentTarget = event.currentTarget; | ||
const subMenu = currentTarget.children[1]; | ||
const expand = currentTarget.children[0].children[1]; | ||
const collapse = currentTarget.children[0].children[2]; | ||
if (currentTarget.dataset.redirect) { | ||
window.location.href = currentTarget.dataset.redirect; | ||
} | ||
if (expand && collapse) { | ||
if (expand.classList.contains('hide')) { | ||
expand.classList.remove('hide'); | ||
collapse.classList.add('hide'); | ||
subMenu.classList.add('closed'); | ||
} else if (collapse.classList.contains('hide')) { | ||
expand.classList.add('hide'); | ||
collapse.classList.remove('hide'); | ||
subMenu.classList.remove('closed'); | ||
} | ||
} | ||
} | ||
} |
{ | ||
"name": "khollenbeck-angular-navigation", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "'Angular/Typescript navigation component'", | ||
@@ -5,0 +5,0 @@ "author": "Kris Hollenbeck", |
### Angular Navigation Component | ||
To be used only with an Angular CLI project. | ||
This component will not work properly with other Angular projects. | ||
This component will not work properly with other Angular projects. | ||
#### Install | ||
`npm install khollenbeck-angular-navigation` | ||
#### Public Functions | ||
``` | ||
// Items to display in navigation menu | ||
items() Array<string> | ||
// Toggle to hide/show navigation menu | ||
toggle() | ||
``` |
@@ -5,2 +5,3 @@ interface KHNavigationItem { | ||
href?: string; | ||
menu?: Array<KHNavigationItem>; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5115
67
16