Skip to content

Commit fe49345

Browse files
crisbetojosephperrott
authored andcommitted
chore(bidi): update docs to be explicit about only looking at elements within Angular (#10076)
1 parent 57babcf commit fe49345

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

guides/bidirectionality.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,30 @@
33
### Setting a text-direction for your application
44
The [`dir` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir)
55
is typically applied to `<html>` or `<body>` element of a page. However, it can be used on any
6-
element to apply a text-direction to a smaller subset of the page.
6+
element, within your Angular app, to apply a text-direction to a smaller subset of the page.
77

88
All Angular Material components automatically reflect the LTR/RTL direction
9-
of their container.
9+
of their container.
1010

1111
### Reading the text-direction in your own components
1212
`@angular/cdk/bidi` provides a `Directionality` injectable that can be used by any component
13-
in your application. To consume this injectable, you must import `BidiModule`
14-
from `@angular/cdk/bidi`.
13+
in your application. To consume it, you must import `BidiModule` from `@angular/cdk/bidi`.
1514

1615
`Directionality` provides two useful properties:
1716
* `value`: the current text direction, either `'ltr'` or `'rtl'`.
1817
* `change`: an `Observable` that emits whenever the text-direction changes. Note that this only
1918
captures changes from `dir` attributes _inside the Angular application context_. It will not
20-
emit for changes to `dir` on `<html>` and `<body>`, as these are assumed to be static.
19+
emit for changes to `dir` on `<html>` and `<body>`, as they are assumed to be static.
2120

2221
#### Example
2322
```ts
24-
@Component({ /* ... */})
23+
@Component({ /* ... */ })
2524
export class MyCustomComponent {
2625
private dir: Direction;
2726

2827
constructor(directionality: Directionality) {
2928
this.dir = directionality.value;
29+
3030
directionality.change.subscribe(() => {
3131
this.dir = directionality.value;
3232
});

0 commit comments

Comments
 (0)