import { ModuleWithProviders, NgModule, OnInit } from '@angular/core'; import { IcsContextMenuComponent } from './ics-context-menu.component'; import { CommonModule } from '@angular/common'; import { OverlayModule } from '@angular/cdk/overlay'; import { ContextOption } from './types/ics-context-option'; import { ICS_CONTEXT_OPTIONS } from './types/ics-context-options'; import { ShareComponent } from './sharing/share/share.component'; import { MatDialogModule } from '@angular/material'; import { SharingService } from './sharing/sharing.service'; import { HTTP_INTERCEPTORS } from '@angular/common/http'; import { IcsDriveModule, IcsDriveService } from '@varmasagi/ics-drive'; import { ICSLoaderModule } from '@varmasagi/loader'; import { IcsToastModule, IcsToastService } from '@varmasagi/ics-toast'; import {HttpClientModule} from '@angular/common/http' /** * @usageNotes: * * export function contextMenus() { * return [CREATE_ACTION, DOWNLOAD, NOTIFICATION]; * } * Import with forRoot at global level of project (if context menus is same across project) or * at module (if this module requires different set of context menus ): * imports:[ * .... * IcsContextMenuModule.forRoot(contextMenus) * .... * ] * Remember to import IcsContextMenuModule in a lazy loaded module. * * For sharing the image of a div, make sure you configure it in this way: * * In your html, *
* ... *
* * * @author Harsha * */ @NgModule({ imports: [CommonModule, OverlayModule, MatDialogModule,HttpClientModule, IcsDriveModule,ICSLoaderModule, IcsToastModule], declarations: [IcsContextMenuComponent, ShareComponent], exports: [IcsContextMenuComponent], entryComponents:[ShareComponent] }) export class IcsContextMenuModule { static forRoot( defaultOption: () => Array ): ModuleWithProviders { return { ngModule: IcsContextMenuModule, providers: [ { provide: ICS_CONTEXT_OPTIONS, useFactory: defaultOption }, SharingService, IcsDriveService, IcsToastService ] }; } }