I want to Create an RTL Template with Angular Material 2 But, I do not know how to do this? Please help me;
You should use rtl as an attribute
dir='rtl'
Here is the plunker
Go to index.html, you will find:
<body > <chips-overview-example dir="rtl">Loading Material Docs example...</chips-overview-example> </body>
you must add the attribute dir=rtlin <html>, because the angular material.js code is using this document.dirto differentiate the direction of the layout
dir=rtl
<html>
document.dir
-, ( Universal selector) styles.css.
Universal selector
styles.css
* { direction: rtl; }
I published a library that works well with a bidirectional solution using scssmixins. Check this:
scss
https://github.com/10bis/ngx-bdir
Angular Material uses a selector [dir=rtl]for some elements in its CSS, for example:
[dir=rtl]
[dir=rtl] .mat-form-field { text-align: right; }
There you need to add an attribute dir=rtlto your tag html:
html
<html dir="rtl">
Source: https://habr.com/ru/post/1664754/More articles:How to fix device policy and network abuse issue in Google Play Store app application - androidLaravel 5: How to reset SQL query? - mysqlSwift 3.0 AVAudioPlayer Playing Audio From Music - iosThe result of "File.mkdirs ()" is ignored - javaIs it possible to check the type of compile time in growth in Rust? - typesHow to select table column values as columns of sum of values - sqlJavascript prototype and Object.create () inheritance? - javascriptAngular2 материал sidenav - динамическое изменение направления rtl/ltr - angularAngular2: перезапустите тег html audio в реальном времени - html5Uninitialized Variables in PHP - initializationAll Articles