Skip to content

Commit

Permalink
Merge pull request #10220 from IgniteUI/dmdimitrov/exporters-import
Browse files Browse the repository at this point in the history
feat(exporters): add providedIn root to exporters
  • Loading branch information
kdinev authored Oct 7, 2021
2 parents 99b22a5 + 80dd86d commit 7fc327b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes for each version of this project will be documented in this file.

## 13.0.0

### New Features
- `IgxCsvExporterService`, `IgxExcelExporterService`
- Exporter services are no longer required to be provided in the application since they are now injected on a root level.

## 12.2.1

### New Features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ export class IgxGridToolbarExporterComponent extends BaseToolbarDirective {

constructor(
@Host() protected toolbar: IgxGridToolbarComponent,
@Optional() private excelExporter: IgxExcelExporterService,
@Optional() private csvExporter: IgxCsvExporterService,
private excelExporter: IgxExcelExporterService,
private csvExporter: IgxCsvExporterService,
) {
super(toolbar);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ export interface ICsvExportEndedEventArgs extends IBaseEventArgs {
* this.csvExportService.exportData(this.localData, opt);
* ```
*/
@Injectable()
@Injectable({
providedIn: 'root',
})
export class IgxCsvExporterService extends IgxBaseExporter {
/**
* This event is emitted when the export process finishes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ const EXCEL_MAX_COLS = 16384;
* this.excelExportService.exportData(this.localData, new IgxExcelExporterOptions("FileName"));
* ```
*/
@Injectable()
@Injectable({
providedIn: 'root',
})
export class IgxExcelExporterService extends IgxBaseExporter {
private static ZIP_OPTIONS = { compression: 'DEFLATE', type: 'base64' } as JSZip.JSZipGeneratorOptions<'base64'>;

Expand Down
4 changes: 1 addition & 3 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { NgModule } from '@angular/core';
import {
IgxIconModule, IgxBottomNavModule, IgxGridModule, IgxExcelExporterService, IgxCsvExporterService, IgxOverlayService,
IgxIconModule, IgxBottomNavModule, IgxGridModule, IgxOverlayService,
IgxDragDropModule, IgxDividerModule, IgxTreeGridModule, IgxHierarchicalGridModule, IgxInputGroupModule,
IgxIconService, DisplayDensityToken, DisplayDensity,
IgxDateTimeEditorModule, IgxDateRangePickerModule, IgxButtonModule, IgxActionStripModule, GridBaseAPIService, IgxButtonGroupModule,
Expand Down Expand Up @@ -327,9 +327,7 @@ const components = [
HierarchicalRemoteService,
GridBaseAPIService,
IgxGridHierarchicalPipe,
IgxExcelExporterService,
IgxIconService,
IgxCsvExporterService,
IgxOverlayService,
{ provide: DisplayDensityToken, useFactory: () => ({ displayDensity: DisplayDensity.comfortable }) },
{
Expand Down

0 comments on commit 7fc327b

Please sign in to comment.