diff --git a/packages/language-service/ivy/test/quick_info_spec.ts b/packages/language-service/ivy/test/quick_info_spec.ts index 9c07fc3457..1160c80000 100644 --- a/packages/language-service/ivy/test/quick_info_spec.ts +++ b/packages/language-service/ivy/test/quick_info_spec.ts @@ -151,6 +151,15 @@ describe('quick info', () => { expect(toText(documentation)).toBe('This Component provides the `test-comp` selector.'); }); + it('should work for components with bound attributes', () => { + const {documentation} = expectQuickInfo({ + templateOverride: ``, + expectedSpanText: ``, + expectedDisplayString: '(component) AppModule.TestComponent' + }); + expect(toText(documentation)).toBe('This Component provides the `test-comp` selector.'); + }); + it('should work for structural directives', () => { const {documentation} = expectQuickInfo({ templateOverride: `
`, diff --git a/packages/language-service/ivy/utils.ts b/packages/language-service/ivy/utils.ts index f204763c62..977d49be78 100644 --- a/packages/language-service/ivy/utils.ts +++ b/packages/language-service/ivy/utils.ts @@ -171,7 +171,7 @@ function getFirstComponentForTemplateFile(fileName: string, compiler: NgCompiler * Given an attribute node, converts it to string form. */ function toAttributeString(attribute: t.TextAttribute|t.BoundAttribute|t.BoundEvent): string { - if (attribute instanceof t.BoundEvent) { + if (attribute instanceof t.BoundEvent || attribute instanceof t.BoundAttribute) { return `[${attribute.name}]`; } else { return `[${attribute.name}=${attribute.valueSpan?.toString() ?? ''}]`;