1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import {Component, OnInit} from '@angular/core';
import {DialogService} from '../dialog/dialog.service';
export class Menu {
name: string;
type: string;
action: any;
}
@Component({
selector: 'app-element-server-menu',
templateUrl: './server-menu.component.html',
styleUrls: ['./server-menu.component.scss'],
})
export class ElementServerMenuComponent implements OnInit {
MenuList: Array<any>;
top: number;
left: number;
constructor(private _dialog: DialogService) {
}
ngOnInit() {
const m = new Menu();
const line = new Menu();
m.action = '';
m.name = 'test';
m.type = 'lll';
line.type = 'line';
this.MenuList = [m, m, line, m, m];
this._dialog.alert('sss');
}
public contextmenu(top: number, left: number) {
this.top = top;
this.left = left;
}
}