Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[BUG] Input Signals implementation is excluding valid cases #1474

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

Closed
mridderikhoff opened this issue Apr 26, 2024 · 1 comment
Closed

[BUG] Input Signals implementation is excluding valid cases #1474

mridderikhoff opened this issue Apr 26, 2024 · 1 comment

Comments

@mridderikhoff
Copy link

Overview of the issue

Recently added support for Signal inputs exclude valid cases. model is also a valid Signal input.

The following cases fail the Regex test /input(?:\.(required))?(?:<([\w-]+)>)?\(([\w-]+)?\)/.

inputName = input('');
readonly = input(false, { transform: booleanAttribute });
labelPosition = input<SwitchLabelPosition>(SwitchLabelPositions.after);
checked = model(false); 
Operating System, Node.js, npm, compodoc version(s)

"@compodoc/compodoc": "1.1.24"

Motivation for or Use Case

Same motiviation as the original issue. Signals are a powerful pattern and the new norm for Angular developers.

Suggest a Fix

Update the checks in src/app/compiler/angular/deps/helpers/component-helper.ts to account for:

  • input with '' default value
  • input with transformers
  • input with complex type parameters
  • model inputs
@angelaman
Copy link

Sorry, I don't think this bug is fixed yet. I just tried it, and many cases listed above are still not supported. I tried to ask AI to write a regex, hope that may help?

/input(\.required)?(<([a-zA-Z_$][\w$]*(\s*<\s*[a-zA-Z_$][\w$]*(\s*,\s*[a-zA-Z_$][\w$]*)*\s*>)?(\[\])?)>)?\(([^)]*)\)/

matches
image

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

No branches or pull requests

3 participants