-
Notifications
You must be signed in to change notification settings - Fork 25
/
angular2-contextmenu.ts
43 lines (41 loc) · 1.19 KB
/
angular2-contextmenu.ts
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
41
42
43
import { CONTEXT_MENU_OPTIONS, IContextMenuOptions } from './src/contextMenu.options';
import { ModuleWithProviders, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ContextMenuComponent } from './src/contextMenu.component';
import { ContextMenuItemDirective } from './src/contextMenu.item.directive';
import { ContextMenuService } from './src/contextMenu.service';
import { ContextMenuAttachDirective } from './src/contextMenu.attach.directive';
export * from './src/contextMenu.component';
export * from './src/contextMenu.service';
@NgModule({
declarations: [
ContextMenuAttachDirective,
ContextMenuComponent,
ContextMenuItemDirective,
],
exports: [
ContextMenuAttachDirective,
ContextMenuComponent,
ContextMenuItemDirective,
],
imports: [
CommonModule,
],
providers: [
ContextMenuService,
],
})
export class ContextMenuModule {
public static forRoot(options: IContextMenuOptions): ModuleWithProviders {
return {
ngModule: ContextMenuModule,
providers: [
{
provide: CONTEXT_MENU_OPTIONS,
useValue: options,
},
],
};
}
}
export default ContextMenuModule;