-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4fbd828
commit b437a91
Showing
2 changed files
with
269 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,273 @@ | ||
# WpNavigation | ||
## Download and install package | ||
|
||
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.2.1. | ||
``` | ||
npm i ng-wordpress-menu | ||
``` | ||
## Import | ||
|
||
## Development server | ||
``` | ||
import { NgWordpressMenu } from 'ng-wordpress-menu'; | ||
``` | ||
## How to use | ||
|
||
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files. | ||
``` | ||
import { Component } from '@angular/core'; | ||
import { NgWpMenu, NgWpMenuTheme } from 'ng-wordpress-menu'; | ||
## Code scaffolding | ||
@Component({ | ||
selector: 'app-root', | ||
template: ` | ||
<div id="wpwrap"> | ||
<ng-wp-menu [menu]="menuModel" [theme]="themeName" [direction]="menuDirection" (onMenuToggle)="onMenuToggle()"></ng-wp-menu> | ||
<div id="wpcontent"> | ||
<div id="wpbody" role="main"> | ||
<div id="wpbody-content"> | ||
<router-outlet></router-outlet> | ||
</div> | ||
</div> | ||
</div> | ||
</div>` | ||
}) | ||
export class AppComponent { | ||
menuDirection:'ltr' | 'rtl' = 'ltr'; | ||
themeName:NgWpMenuTheme = 'default'; | ||
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. | ||
onMenuToggle() { | ||
console.log('menu toggled'); | ||
} | ||
## Build | ||
menuModel: NgWpMenu = { | ||
'menuName': 'Primary Menu', | ||
'collapseLable': 'Collapse menu', | ||
'menuGroups': | ||
[ | ||
[ | ||
{ | ||
"routerLink": "/home", | ||
"icon": "dashicons-dashboard", | ||
"name": "Dashboard", | ||
"isOpen": false, | ||
"isSelected": false, | ||
"children": [ | ||
{ | ||
"routerLink": "/home", | ||
"name": "Home", | ||
}, | ||
{ | ||
"routerLink": "/updates", | ||
"name": "Updates", | ||
}, | ||
] | ||
} | ||
], | ||
[ | ||
{ | ||
"routerLink": "/posts", | ||
"icon": "dashicons-admin-post", | ||
"name": "Posts", | ||
"isOpen": false, | ||
"isSelected": false, | ||
"children": [ | ||
{ | ||
"routerLink": "/posts", | ||
"name": "All Posts", | ||
}, | ||
{ | ||
"routerLink": "/add-post", | ||
"name": "Add New", | ||
}, | ||
{ | ||
"routerLink": "/categories", | ||
"name": "Categoties", | ||
}, | ||
{ | ||
"routerLink": "/tags", | ||
"name": "Tags", | ||
}, | ||
] | ||
}, | ||
{ | ||
"routerLink": "/library", | ||
"icon": "dashicons-admin-media", | ||
"name": "Media", | ||
"isOpen": false, | ||
"isSelected": false, | ||
"children": [ | ||
{ | ||
"routerLink": "/library", | ||
"name": "Library", | ||
}, | ||
{ | ||
"routerLink": "/add-new-library", | ||
"name": "Add New", | ||
} | ||
] | ||
}, | ||
{ | ||
"routerLink": "/pages", | ||
"icon": "dashicons-admin-page", | ||
"name": "Pages", | ||
"isOpen": false, | ||
"isSelected": false, | ||
"children": [ | ||
{ | ||
"routerLink": "/all-pages", | ||
"name": "All Pages", | ||
}, | ||
{ | ||
"routerLink": "/add-new", | ||
"name": "Add New", | ||
} | ||
] | ||
}, | ||
{ | ||
"routerLink": "/comments", | ||
"icon": "dashicons-admin-comments", | ||
"name": "Comments", | ||
"isOpen": false, | ||
"isSelected": false, | ||
"children": [] | ||
} | ||
], | ||
[ | ||
{ | ||
"routerLink": "/preview", | ||
"icon": "dashicons-admin-appearance", | ||
"name": "Appearance", | ||
"isOpen": false, | ||
"isSelected": false, | ||
"children": [ | ||
{ | ||
"routerLink": "/theme", | ||
"name": "Themes", | ||
}, | ||
{ | ||
"routerLink": "/editor", | ||
"name": "Editor", | ||
"badge": "beta" | ||
}, | ||
] | ||
}, | ||
{ | ||
"routerLink": "/plugins", | ||
"icon": "dashicons-admin-plugins", | ||
"badge": "2", | ||
"name": "Plugins", | ||
"isOpen": false, | ||
"isSelected": false, | ||
"children": [ | ||
{ | ||
"routerLink": "/installed-plugins", | ||
"name": "Installed Plugins", | ||
}, | ||
{ | ||
"routerLink": "/add", | ||
"name": "Add New", | ||
} | ||
] | ||
}, | ||
{ | ||
"routerLink": "/users", | ||
"icon": "dashicons-admin-users", | ||
"name": "Users", | ||
"isOpen": false, | ||
"isSelected": false, | ||
"children": [ | ||
{ | ||
"routerLink": "/all-users", | ||
"name": "All Users", | ||
}, | ||
{ | ||
"routerLink": "/add-user", | ||
"name": "Add New", | ||
}, | ||
{ | ||
"routerLink": "/user-id", | ||
"name": "Profile", | ||
} | ||
] | ||
}, | ||
{ | ||
"routerLink": "/icons", | ||
"icon": "dashicons-admin-tools", | ||
"name": "Icons", | ||
"isOpen": false, | ||
"isSelected": false, | ||
"children": [ | ||
{ | ||
"routerLink": "/all-tools", | ||
"name": "Available Tools", | ||
}, | ||
{ | ||
"routerLink": "/import", | ||
"name": "Import", | ||
}, | ||
{ | ||
"routerLink": "/export", | ||
"name": "Export", | ||
}, | ||
{ | ||
"routerLink": "/health", | ||
"name": "Site Health", | ||
}, | ||
{ | ||
"routerLink": "/export-personals", | ||
"name": "Export Personal Data", | ||
}, | ||
{ | ||
"routerLink": "/clean-personals", | ||
"name": "Erase Personal Data", | ||
}, | ||
{ | ||
"routerLink": "/theme-editor", | ||
"name": "Theme File Editor", | ||
}, | ||
{ | ||
"routerLink": "/plugin-editor", | ||
"name": "Plugin File Editor", | ||
} | ||
] | ||
}, | ||
{ | ||
"routerLink": "/settings", | ||
"icon": "dashicons-admin-settings", | ||
"name": "Settings", | ||
"isOpen": false, | ||
"isSelected": false, | ||
"children": [ | ||
{ | ||
"routerLink": "/public", | ||
"name": "General", | ||
}, | ||
{ | ||
"routerLink": "/write", | ||
"name": "Writing", | ||
}, | ||
{ | ||
"routerLink": "/read", | ||
"name": "Reading", | ||
}, | ||
{ | ||
"routerLink": "/discussion", | ||
"name": "Discussion", | ||
}, | ||
{ | ||
"routerLink": "/media", | ||
"name": "Media", | ||
}, | ||
{ | ||
"routerLink": "/permalink", | ||
"name": "Permalinks", | ||
}, | ||
{ | ||
"routerLink": "/privacy", | ||
"name": "Privacy", | ||
}, | ||
] | ||
}, | ||
], | ||
], | ||
}; | ||
} | ||
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. | ||
|
||
## Running unit tests | ||
|
||
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). | ||
|
||
## Running end-to-end tests | ||
|
||
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. | ||
|
||
## Further help | ||
|
||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. | ||
``` |