swimlane / ngx-dnd

🕶 Drag, Drop and Sorting Library for Angular2 and beyond!
https://swimlane.github.io/ngx-dnd/
MIT License
575 stars 138 forks source link

[AOT] Can't compile ngx-dnd using ng-packagr #83

Closed ssuperczynski closed 6 years ago

ssuperczynski commented 6 years ago

I'm submitting a ...

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Sorry, we will not be able to answer every support request.  Please consider other venues for support requests

ng-packagr produces error on ngxDraggable: "Expected 0 arguments, but got 1."

Current behavior

<table class="table">
  <tbody ngxDroppable>
    <ng-container *ngFor="let row of data">
      <tr ngxDraggable>
        some item
      </tr>
    </ng-container>
  </tbody>
</table>

Ngx-dnd is added to the project and works correctly. However when I try to build package to send to npm usingng-packagr I get error:


Building Angular Package
Building entry point 'ngx-easy-table'
Rendering Stylesheets
Rendering Templates
Compiling TypeScript sources through ngc

BUILD ERROR
node_modules/@swimlane/ngx-dnd/release/components/container/container.component.html(11,7): : Directive DraggableDirective, Expected 0 arguments, but got 1.
node_modules/@swimlane/ngx-dnd/release/components/container/container.component.html(11,7): : Directive DraggableDirective, Expected 0 arguments, but got 1.
src/app/ngx-easy-table/components/base/base.component.ts.BaseComponent.html(16,11): : Directive DraggableDirective, Expected 0 arguments, but got 1.
src/app/ngx-easy-table/components/base/base.component.ts.BaseComponent.html(16,11): : Directive DraggableDirective, Expected 0 arguments, but got 1.

Error: node_modules/@swimlane/ngx-dnd/release/components/container/container.component.html(11,7): : Directive DraggableDirective, Expected 0 arguments, but got 1.
node_modules/@swimlane/ngx-dnd/release/components/container/container.component.html(11,7): : Directive DraggableDirective, Expected 0 arguments, but got 1.
src/app/ngx-easy-table/components/base/base.component.ts.BaseComponent.html(16,11): : Directive DraggableDirective, Expected 0 arguments, but got 1.
src/app/ngx-easy-table/components/base/base.component.ts.BaseComponent.html(16,11): : Directive DraggableDirective, Expected 0 arguments, but got 1.
Angular CLI: 6.0.3
Node: 9.6.1
OS: darwin x64
Angular: 6.0.2
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.3
@angular-devkit/build-angular     0.6.3
@angular-devkit/build-optimizer   0.6.3
@angular-devkit/core              0.6.3
@angular-devkit/schematics        0.6.3
@angular/cli                      6.0.3
@ngtools/json-schema              1.1.0
@ngtools/webpack                  6.0.3
@schematics/angular               0.6.3
@schematics/update                0.6.3
ng-packagr                        3.0.0-rc.5
rxjs                              6.1.0
typescript                        2.7.2
webpack                           4.8.3
ssuperczynski commented 6 years ago

This error comes from "fullTemplateTypeCheck" in the tsconfig.json, since it is enabled by default in Angular6. See #84 for fix