Angular 6 library compile error: Directive NbContextMenuDirective, Expected 0 arguments, but got 1.
See original GitHub issueIssue type
I’m submitting a …
- bug report
- feature request
Issue description
Current behavior:
Can’t compile angular 6 library using NbContextMenuDirective
got the error :
projects/demo/src/lib/demo.component.ts.DemoComponent.html(4,7): : Directive NbContextMenuDirective, Expected 0 arguments, but got 1.
Expected behavior:
Should compile 😄
Steps to reproduce:
git clone https://github.com/osixia/nebular-bug
cd nebular-bug
npm install
ng build demo
Related code:
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'lib-demo',
template: `
<p>
demo works!
<button [nbContextMenu]="items">Click me</button>
</p>
`,
styles: []
})
export class DemoComponent implements OnInit {
items = [{ title: 'Profile' }, { title: 'Log out' }];
constructor() { }
ngOnInit() {
}
}
Other information:
npm, node, OS, Browser
node --version
v8.10.0
npm --version
6.2.0
Angular, Nebular
"@angular/core": "^6.0.3",
[...]
"@nebular/theme": "^2.0.0-rc.10",
"ng-packagr": "^3.0.0-rc.2" and "ng-packagr": "^4.1.0", tested with same result
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8
Top Results From Across the Web
Angular 6 - Directive SomeComponent, Expected 0 arguments ...
I meet some similar error called ERROR in (1,1): : Directive SomeComponent, Expected 0 arguments, but got 1. as described inside this ...
Read more >Expected 0 arguments, but got 1 error in TypeScript | bobbyhadz
The error "Expected 0 arguments, but got 1" occurs when we pass an argument to a function that doesn't take any arguments. To...
Read more >The "Expected 0 arguments, but got 1." errors occur when ...
I updated the devextreme libraries to 17.2.4 version and now everytime I try to build with -prod parameter, this error appears: ERROR in...
Read more >Realm.App({id: ''}) | Expected 0 arguments, but got 1.ts(2554)
I installed Realm using npm install --save realm@10.0.0-beta.6 , as directed by the Install Realm for Node.js guide. Lauren_Schaefer (Lauren ...
Read more >Expected 0 arguments, but got 1.ts(2554)-angular.js
Coding example for the question Service Error : Expected 0 arguments, but got 1.ts(2554)-angular.js.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@BertrandGouny thanks! Here is the reason https://github.com/akveo/nebular/blob/2.0.0-rc.10/src/framework/theme/components/context-menu/context-menu.directive.ts#L168 and here is the explanation https://stackoverflow.com/a/50409526/6272699.
Since we rework the popover based components quite a lot since the previous RC, we need to check if this is still the case.
On a side note, the demo component is missing
<nb-layout><nb-layout-column>...</
which are required by Nebular.@arabbani next week!