HalitTalha / ng-material-extensions

Extended features for @angular/material components
Apache License 2.0
101 stars 52 forks source link

Error Argument of type '"xlsx"' is not assignable to parameter of type 'ExportType'. #17

Closed djdex83 closed 5 years ago

djdex83 commented 5 years ago

Hi. In my Angular 8 project, I have buttons to export data from my mat-table. I have added the button:

<button mat-button class="a-btn a-btn-primary a-btn-lg" matTooltip="Esporta in Excel" aria-label="Esporta in Excel" [matTooltipPosition]="position.value" (click)="exporter.exportTable('xlsx', {fileName:'BandiGare', sheet: 'BandiGare', Props: {Author: 'Admin'}})">

when I try to build: ng build --prod

I obtain:

Error Argument of type '"xlsx"' is not assignable to parameter of type 'ExportType'.

Why??

My package.json is: "dependencies": { "@angular/animations": "^8.2.5", "@angular/cdk": "^8.1.4", "@angular/common": "~8.2.4", "@angular/compiler": "~8.2.4", "@angular/core": "~8.2.4", "@angular/flex-layout": "^8.0.0-beta.27", "@angular/forms": "~8.2.4", "@angular/material": "^8.1.4", "@angular/platform-browser": "~8.2.4", "@angular/platform-browser-dynamic": "~8.2.4", "@angular/router": "~8.2.4", "angular-jwt": "^0.1.11", "angular5-csv": "^0.2.11", "appkit": "^3.2.0", "cdk-table-exporter": "^1.2.1", "hammerjs": "^2.0.8", "install": "^0.13.0", "jsonwebtoken": "^8.5.1", "jwt-decode": "^2.2.0", "mat-table-exporter": "^1.2.1", "moment": "^2.24.0", "ngx-avatar": "^3.7.0", "rxjs": "~6.4.0", "tslib": "^1.10.0", "xlsx": "^0.15.1", "zone.js": "~0.9.1" }, "devDependencies": { "@angular-devkit/build-angular": "~0.803.2", "@angular/cli": "~8.3.2", "@angular/compiler-cli": "~8.2.4", "@angular/language-service": "~8.2.4", "@types/node": "~8.9.4", "@types/jasmine": "~3.3.8", "@types/jasminewd2": "~2.0.3", "codelyzer": "^5.0.0", "jasmine-core": "~3.4.0", "jasmine-spec-reporter": "~4.2.1", "karma": "~4.1.0", "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "~2.0.1", "karma-jasmine": "~2.0.1", "karma-jasmine-html-reporter": "^1.4.0", "protractor": "~5.4.0", "ts-node": "~7.0.0", "tslint": "~5.15.0", "typescript": "~3.5.3" } }

HalitTalha commented 5 years ago

Thank you for reporing, there is already an issue record regarding this, you can get rid of the error by using the directive as it is discribed in this issue record: https://github.com/HalitTalha/mat-table-extensions/issues/15

Actually we had considered it as a docs problem but Im considering to fix this to be able to work with string values too. So keeping this as a bug record.