Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-exported abstract directive input treated as error #1891

Open
1 of 2 tasks
csisy opened this issue May 8, 2023 · 1 comment
Open
1 of 2 tasks

Non-exported abstract directive input treated as error #1891

csisy opened this issue May 8, 2023 · 1 comment
Labels

Comments

@csisy
Copy link

csisy commented May 8, 2023

🐞 bug report

Is this a regression?

Not sure.

Description

I have an abstract directive with a custom input and another one that extends it:

@Directive()
abstract class MyBaseDirective {
  @Input() myInput = '';
}

@Directive({ selector: 'a[my-directive]' })
export class MyDirective extends MyBaseDirective { /* ... */ }

As you can see, the MyBaseDirective is not even exported from the file, because it is kind of a private DRY solution. The MyDirective is of course declared in the main app module.

When I try to use the myInput of an <a> element...

<a [myInput]="myVar">Link</a>

...I get an error message: Can't bind to 'myInput' since it isn't a known property of 'a'.

The code itself is working fine, and if I export the MyBaseDirective, the error disappears.

Bug Type

What does this bug affect

  • Angular Language Service VSCode extension
  • Angular Language Service server

Expected behavior

The inherited inputs and outputs from a non-exported directive should be detected properly.

🌍 Your Environment

Angular Version:

Angular CLI: 15.2.6
Node: 18.15.0      
Package Manager: npm 9.5.0
OS: win32 x64

Angular: 15.2.8
... animations, cdk, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1502.6
@angular-devkit/build-angular   15.2.6
@angular-devkit/core            15.2.6
@angular-devkit/schematics      15.2.6
@angular/cli                    15.2.6
@schematics/angular             15.2.6
rxjs                            7.8.0
typescript                      4.9.5

Extension Version:

v16.0.0

VSCode Version:

Version: 1.77.3 (user setup)
Commit: 704ed70d4fd1c6bd6342c436f1ede30d1cff4710
Date: 2023-04-12T09:16:02.548Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Windows_NT x64 10.0.19045
Sandboxed: No

Operating System:

Windows 10 Version 22H2 OS Build 19045.2846

Additional Info

Might be related? #150

@csisy csisy added the bug label May 8, 2023
@ravindUwU
Copy link

if I export the MyBaseDirective, the error disappears

omg ✨ thanks!!! ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants