Greetings! Currently I am in the process of developing a web application using AngularJS SPA, which supports both English and Arabic languages. I am facing an issue with adding RTL and LTR properties by applying classes to the body HTML element in my app.js file as seen below:
$scope.changeLanguage = function (lang) {
$scope.lang = lang == 'de_AR' ? 'de_AR' : 'de_EN';
var myEl = angular.element(document.querySelector('#body'));
myEl.addClass('rtl');
}
Despite implementing the above code snippet, I have not been able to successfully add the class. The rendered HTML in the browser displays the following:
<body ng-controller="RoslpAppController" class="ng-scope">
I am seeking assistance on the correct method to apply CSS classes using AngularJS. Could you please provide insights on this matter?