docs: align list formatting and improve emphasis

Aligns list formatting, replaces the “Helpful” block with an
IMPORTANT note for better visibility, and removes the separate
example file by inlining the single relevant line directly
in the documentation.
This commit is contained in:
Shuaib Hasan Akib 2026-02-26 21:52:40 +06:00 committed by Pawel Kozlowski
parent 7d54952e85
commit efbba945bc
3 changed files with 13 additions and 14 deletions

View file

@ -1,3 +0,0 @@
<!-- #docregion unsupported -->
<p app:Highlight>This is invalid</p>
<!-- #enddocregion unsupported -->

View file

@ -1,7 +0,0 @@
// #docregion
import {Directive} from '@angular/core';
@Directive({
selector: '[appHighlight]',
})
export class HighlightDirective {}

View file

@ -14,7 +14,14 @@ This section walks you through creating a highlight directive that sets the back
The CLI creates `src/app/highlight.directive.ts`, a corresponding test file `src/app/highlight.directive.spec.ts`.
<docs-code header="highlight.directive.ts" path="adev/src/content/examples/attribute-directives/src/app/highlight.directive.0.ts"/>
```angular-ts
import {Directive} from '@angular/core';
@Directive({
selector: '[appHighlight]',
})
export class HighlightDirective {}
```
The `@Directive()` decorator's configuration property specifies the directive's CSS attribute selector, `[appHighlight]`.
@ -25,11 +32,13 @@ This section walks you through creating a highlight directive that sets the back
1. Add logic to the `HighlightDirective` class that sets the background to yellow.
<docs-code header="highlight.directive.ts" path="adev/src/content/examples/attribute-directives/src/app/highlight.directive.1.ts"/>
<docs-code header="highlight.directive.ts" path="adev/src/content/examples/attribute-directives/src/app/highlight.directive.1.ts"/>
HELPFUL: Directives _do not_ support namespaces.
IMPORTANT: Directives _do not_ support namespaces.
<docs-code header="app.component.avoid.html (unsupported)" path="adev/src/content/examples/attribute-directives/src/app/app.component.avoid.html" region="unsupported"/>
```angular-html {avoid}
<p app:Highlight>This is invalid</p>
```
## Applying an attribute directive