Coder Social home page Coder Social logo

shankytiwari / ng-material-multilevel-menu Goto Github PK

View Code? Open in Web Editor NEW
97.0 7.0 54.0 4.26 MB

:page_facing_up: Material Multi-Level Menu for Angular Projects

Home Page: http://plugins.codershood.info/#/plugins/ngmm-plugin

License: MIT License

JavaScript 2.00% TypeScript 75.54% HTML 13.41% CSS 9.04%
multilevel-list material-list angular-multilevel-list angular angular6 angular-material angular-multilevel-menu multilevel-menu

ng-material-multilevel-menu's People

Contributors

bennymeg avatar dependabot[bot] avatar marxsk avatar moonwateram avatar shankytiwari avatar stavm avatar stefan-karlsson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ng-material-multilevel-menu's Issues

Routing Not working

How do i navigate to another route? How do I need to make the link in config array working. I am getting below errors:

core.js:12301 ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'item-1-1'

ERROR TypeError: Cannot read property 'navigateByUrl' of undefined

I need to know where I amon the tree

Hi!

I need to know on a click if this is a Label or an Item.

I've seen the two methods.
(selectedItem)="selectedItem($event)"
(selectedLabel)="selectedLabel($event)"
but Ive mine on a click and this is when i need to know where i am on the tree.
(click)="toogleSidebar()"
Thx !

external link

Do not have the option to put external link? Out of application

How selectedItem() event works ?

Hello,

Just a quick question about how (selectedItem) works, I can't figure it myself. My appItems array has a special field with a special value I want to send to a service when the link is clicked. I tried to add a onSelect property to my object without success.

Could you please give me some advice ?

Thanks a lot,

Menu is not responding to a route change when NgIf is used

The root cause of the issue is, Route change was never detected because NgIf removed the element from the DOM tree. Basically, this menu detects the route change on NavigationEnd instance of Angular Route.
By the time NgIf displays the menus, NavigationEnd event never happens for the Menu, beacuse it is alreday passed.
While I fix the issue, I have a solution, Please ngClass instead of NgIf.

svgIcon support

Can you please add support for SVG ICONS in menu item. like below.

<mat-icon svgIcon="ic-my-icon-name"></mat-icon>

Refreshing / translating menu

I would like to translate the menu using ngx-translate.
When user changes language I need to reload the menu or replace it's labels.
Is there a way to replace labels or update items?

Missing list of packages to add to your project

Hi
When i use yarn to add the module:
yarn add --save ng-material-multilevel-menu

I get this error:
yarn add v1.13.0 error Missing list of packages to add to your project. info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Internationalization using ngx-translate

Hi, I wan to translate using ngx-translate/core.
The way i know to use ngx-translate in the following way.

<h1>{{ 'demo.title' | translate }}</h1>

<!-- translation: directive (key as attribute)-->
<p [translate]="'demo.text'"></p>

<!-- translation: directive (key as content of element) -->
<p translate>demo.text</p>

https://www.codeandweb.com/babeledit/tutorials/how-to-translate-your-angular8-app-with-ngx-translate

How do i use it in
appItems = [
{
label:'Employee' ,
icon: 'person_outline',
link: 'hrm/employee',
}]

Probleme

i have this probleme i add NO-SCHEMMA But Noting please help
Uncaught Error: Template parse errors:
Can't bind to 'configuration' since it isn't a known property of 'ng-material-multilevel-menu'.

  1. If 'configuration' is an Angular directive, then add 'CommonModule' to the '@NgModule.imports' of this component.
  2. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("

Routing not working with routes with spaces

I created a menu that is having links with spaces . When there are no special characters (%20) my route is always highlighted in the menu, but when the route contains a space it is not highlighting the right item in the menu.

Request for new method (selectedLabel)="selectedLabel($event)

Currently this package has only (selectedItem)="selectedItem($event)
It would be great to have (selectedLabel)="selectedLabel($event) also.
Because sometimes I'd like to know which Menu Category has been selected thanks to that I could display all its subcategories. Can you add it, please?

disabled and specific classes functionality in angular-material-multilevel-menu

I get what I need except disabled and different classes feature for nested angular material menu Is it possible to do that or suggest me any other angular material nested menu

What I need:

I need to disable some menus for specific users, it's done by either class or disabled attribute

Its a good feature although and of very common use.

Not installing on Angular 7

Hi,

I'm getting the below warning when running the project with gulp in Angular 7.1.1. Please update the dependencies.

npm WARN [email protected] requires a peer of @angular/common@^6.0.0-rc.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@^6.0.0-rc.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.

Open the menu when initialised

Hi,
I am using your ng-material-multilevel-menu for a MEAN stack project that I am doing.
It works properly and I would like to thank you for that!

However, I would like to know if there was an option or a way to display all the items when initialized instead of clicking on it ?

Thank you,
Regards,

Selected item color

The color of the selected item does not appear in my application like your example. I believe that may be some conflict with some other component. Is there any class that can be modified to force the color change when an item is selected?

Interface with route with query params

Hi,

I see interfaceWithRoute doesn't work when there are query params in the url. Please let me know if I can achieve this in some other way.

Thanks,
Pradeep

remove border-top-style mat-divider, cursor pointer, routerlink

Hi,

Can not get border-top-style and border-whidth and border-top-color of component mat-divider?

I've tried these ways:

.```
mat-divider {
    border-top-width: 0px! important;
    border-top-style: none! important;
}


and

.mat-divider.mat-divder-inset {
    border-top-width: 0px! important;
    border-top-style: none! important;
}

Also it is not possible to modify the pointer cursor?

.class-custom {
    cursor: pointer
}

Is it also not possible to use routelink?

Thank you.

Overriding Menu Items Styles

Hi,

I am looking to make the menu items smaller for both the icon and the text. Is there any way to do this easily? I try to override your styles but none of it seems to take.

Do you have any suggestions on doing this?

some routes don't "activate" the corresponding menu item when redirected by angular

There's an issue where if you define a route with 'redirect'. the route is recognized by angular, but the menu item isn't responding as you would expect.

so if my route object is this:

const routes = [
  {
    path: 'aa', component: ComponentParentComponent, children: [
      { path: '', redirectTo: '/aa/a', pathMatch: 'full' },
      { path: 'a', component: ComponentAComponent },
      { path: 'b', component: ComponentBComponent }
    ]
  }
]

and i navigate to

localhost:4200/#/aa

the route is changed to /#/aa/a by the angular router, though the corresponding menu item, isn't being activated and expanded accordingly.

bug can be seen here : Stackblitz Demo

Default Selection

Hi,

Any option for Menu selection by default, when enter the page?

For example when i enter in web site home page viewed.. at the same time home menu need to go selected state.

Styles are broken when using Menu within <mat-card>

If <app-business-menu> is used inside <mat-card> then styles (gray lines) seems to be broken.

image

However I noticed that If i remove position: relative here:
image

Then it looks ok, but gray effect whilst clicking on record doesn't work properly.
image

Can you fix it or give me temporary workaround for this?

Custom appearance when mouse over (Hover mouse on item list)

Hi! Thank you for this great library! I found it very intuitive and effective.

But I have a particular need.
I want to do custom styling on the list items when mouse over event if fired.

So I tryed to sec my custom class name in my component, and then setting the :hover css modifier, but nothing seems to happen.
I'm new about angular and probably I'm doing something wrong.
Thanks for support.

my sidenav-menu.component.ts file:

config = {
  paddingAtStart: true,
  interfaceWithRoute: true,
  classname: 'side-nav-menu',
  rtlLayout: false
};

sidenav-menu.component.css file:

.side-nav-menu .mat-list-item:hover {
  background: dodgerblue;
}

export 'defineInjectable' was not found in '@angular/core'

Are there any minimum requirements for this module? I'm getting the error below, maybe its because I'm using Angular 5?

Error:

WARNING in ./node_modules/ng-material-multilevel-menu/fesm5/ng-material-multilevel-menu.js
142:63-79 "export 'defineInjectable' was not found in '@angular/core'

Below is my setup:

"dependencies": {
    "@angular/animations": "^5.2.5",
    "@angular/cdk": "^5.2.5",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "^5.2.0",
    "@angular/core": "^5.2.0",
    "@angular/forms": "^5.2.0",
    "@angular/http": "^5.2.0",
    "@angular/material": "^5.2.5",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@angular/platform-server": "^5.2.0",
    "@angular/router": "^5.2.0",
    "@aspnet/signalr": "^1.0.0",
    "@fortawesome/angular-fontawesome": "^0.1.1",
    "@fortawesome/fontawesome-svg-core": "^1.2.2",
    "@fortawesome/free-brands-svg-icons": "^5.2.0",
    "@fortawesome/free-regular-svg-icons": "^5.2.0",
    "@fortawesome/free-solid-svg-icons": "^5.2.0",
    "@ng-bootstrap/ng-bootstrap": "1.0.0-beta.5",
    "@ngx-translate/core": "^8.0.0",
    "@ngx-translate/http-loader": "^2.0.0",
    "@types/node": "^6.0.115",
    "angular-2-dropdown-multiselect": "1.6.3",
    "angular-oauth2-oidc": "^2.1.8",
    "angular-tree-component": "^7.0.2",
    "angular2-jwt": "^0.2.3",
    "bootstrap": "4.0.0-beta.2",
    "bootstrap-sass": "^3.3.7",
    "classlist.js": "^1.1.20150312",
    "core-js": "^2.4.1",
    "countup.js-angular2": "^1.1.1",
    "datatables.net-dt": "^1.10.19",
    "file-saver": "^1.3.3",
    "hammerjs": "^2.0.8",
    "intl": "^1.2.5",
    "jquery": "^3.3.1",
    "jquery-ui": "^1.12.1",
    "jshint": "^2.9.5",
    "metismenu": "^2.7.0",
    "ng-material-multilevel-menu": "^4.0.4",
    "ngx-cookie-service": "^1.0.9",
    "ngx-perfect-scrollbar": "^4.6.4",
    "ngx-scrollbar": "2.1.0",
    "pace-js": "^1.0.2",
    "popper.js": "^1.12.5",
    "primeicons": "^1.0.0-beta.10",
    "primeng": "^5.2.7",
    "rxjs": "^6.2.2",
    "rxjs-compat": "^6.2.2",
    "signalr": "^2.3.0",
    "web-animations-js": "^2.3.1",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular/cli": "~1.7.3",
    "@angular/compiler-cli": "^5.2.0",
    "@angular/language-service": "^5.2.0",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/jquery": "^2.0.48",
    "@types/node": "~6.0.60",
    "bootstrap-sass": "^3.3.7",
    "codelyzer": "^4.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "~2.5.3"
  }

Update: ng -v gives below

Angular CLI: 1.7.4
Node: 8.11.3
OS: win32 x64
Angular: 5.2.11
... common, compiler, compiler-cli, core, forms, http
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router

@angular/animations: 5.2.5
@angular/cdk: 5.2.5
@angular/cli: 1.7.4
@angular/material: 5.2.5
@angular-devkit/build-optimizer: 0.3.2
@angular-devkit/core: 0.3.2
@angular-devkit/schematics: 0.3.2
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.2
@schematics/angular: 0.3.2
@schematics/package-update: 0.3.2
typescript: 2.5.3
webpack: 3.11.0

Call function instead of routing

Hi, I'm using your menu to navigate throught different pages, but I want to make a last entry to sign out. Is there any way to call a function that performs the logout when I click?

Selected menu background color.

Hello,
If i want to highlight selected menu.

For instance company is clicked. i want different background for companay menu.
How to do that?
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.