Is there a way to add the lang='fa' attribute to all input:text elements in my form using Angular?
I have a specific condition in mind: if the body of the document has the class 'fa', I want to apply the lang="fa" attribute to all input:text elements that are not of type email.
While I know how to achieve this using jQuery, I am unsure of how to do it in an Angular-specific manner.
You can find an example of what I want to achieve with jQuery in this fiddle: Demo
Jquery :
$(document).ready(function(){
if($("body").hasClass('fa')){
if('input:text'){
$('input:text').attr('lang','fa');
}
}
});