Skip to content

Commit e2633d1

Browse files
authored
build: don't show import path if there is no primary export (#22804)
Currently we show something like `import {} from '@angular/cdk/coercion'` for imports that don't have a primary export. These changes remove the line if there is no primary export.
1 parent 5c1ce74 commit e2633d1

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

tools/dgeni/templates/entry-point.template.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,15 @@ <h2>
3636
API reference for Angular {$ doc.packageDisplayName $} {$ doc.displayName $}
3737
</h2>
3838

39-
<p class="docs-api-module-import">
40-
<code>
41-
import {{$ doc.primaryExportName $}} from '{$ doc.moduleImportPath $}';
42-
</code>
43-
</p>
39+
{%- if doc.primaryExportName -%}
40+
<p class="docs-api-module-import">
41+
<code>
42+
import {{$ doc.primaryExportName $}} from '{$ doc.moduleImportPath $}';
43+
</code>
44+
</p>
45+
{% else %}
46+
<p>Import symbols from <code>{$ doc.moduleImportPath $}</code></p>
47+
{%- endif -%}
4448

4549
{%- if doc.services.length -%}
4650
<h3 id="{$ doc.name $}-services" class="docs-header-link docs-api-h3">

0 commit comments

Comments
 (0)