File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 1+ # Angular Material bi-directionality
2+
3+ ### How to set your application direction
4+ The simplest way is applying ` dir ` attribute on either the ` html ` or ` body ` tags.
5+ All material components would automatically inherit the application direction.
6+
7+ You can change the direction for a specific part of you application by applying ` dir ` attribute on the container element.
8+
9+ ### How to develop bi-directional components
10+ In your component import ` Directionality ` out of ` @angular/cdk `
11+ And inject it in your component constructor
12+ ``` ts
13+ constructor (_dir : Directionality ) {
14+ console .log (_dir .value );
15+ }
16+ ```
17+ Now you have access to the application direction,
18+ You can also subscribe to ` change ` :
19+ ``` ts
20+ _dir .change .subscribe (() => // DO SOMETHING );
21+ ` ` `
22+ And be notified for every direction change.
You can’t perform that action at this time.
0 commit comments