diff --git a/packages/language-service/ivy/test/quick_info_spec.ts b/packages/language-service/ivy/test/quick_info_spec.ts index 722e989f5d8..6369c11913a 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 a7ab8156b87..a0a1263f3d7 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() ?? ''}]`;