Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Problem after updating to 2.1.0 #41

Open
anvial opened this issue Nov 27, 2019 · 2 comments
Open

Problem after updating to 2.1.0 #41

anvial opened this issue Nov 27, 2019 · 2 comments

Comments

@anvial
Copy link

anvial commented Nov 27, 2019

Hi! After update to latest version. Get the error:

image

Before (on 1.1.4) everything was OK.

Any solutions?

Thx

@scttcper
Copy link
Owner

did you read release notes https://github.com/TypeCtrl/ngx-rightclick/releases

@anvial
Copy link
Author

anvial commented Nov 28, 2019

I suppose you mean 'breaking changes':

  • requires animations in all menus, requires angular 8

Yes, I add aninations in menu component

import {
  animate,
  state,
  style,
  transition,
  trigger,
} from '@angular/animations';
import { Component, OnInit } from '@angular/core';
import { MenuComponent, ContextMenuService, MenuPackage } from '@ctrl/ngx-rightclick';


@Component({
  selector: 'ngx-vis-context-menu',
  templateUrl: './vis-context-menu.component.html',
  styleUrls: ['./vis-context-menu.component.scss'],
  animations: [
    trigger('menu', [
      state('enter', style({ opacity: 1 })),
      state('exit, void', style({ opacity: 0 })),
      transition('* => *', animate(250)),
    ]),
  ],
  host: {
    '[@menu]': '_state',
    '(@menu.done)': '_onAnimationDone($event)',
  },
})
export class VisContextMenuComponent extends MenuComponent implements OnInit {

  lazy = false;

  constructor(
    public mp: MenuPackage,
    public cms: ContextMenuService,
  ) {
    super(mp, cms);
    // grab any required menu context passed via menuContext input
    // console.log(mp.context)
  }

  ngOnInit() {
    // console.debug('context menu init');
  }

  handleClick(event, action) {
    // IMPORTANT! tell the menu to close, anything passed in here is given to (menuAction)
    this.cms.closeAll({
      action: action,
      x: event.clientX,
      y: event.clientY
    });
  }

  handleMenuAction(event) {
    console.warn('event = ', event);
  }
}

I use Angular 8. And I still have this error:
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants