Is there a way I can do this with Angular Filter? For some reasons I'm not allowed to do it by Javascript ways, and creating additional files is not allowed as well
BTW, the purpose of the codes is to compare the users inputs whatever it is uppercase or lowercase, not just display the varName
<span data-ng-show="varName.toUpperCase() == 'YOURNAME'">
Aswsome name !</span>
<span data-ng-hide="varName.toUpperCase() == 'YOURNAME'">
{{varName}} is not my name.</span>
I have tried something like this but failed
<span data-ng-show="varName|uppercase == 'YOURNAME'">
Aswsome name !</span>
you have to use like this ....
{{ uppercase_expression | uppercase}}
Example :
<div ng-app>
<p>
<label>Enter your name (in lower case)</label>
<input type="text" ng-model="yourname" />
</p>
<p> {{ yourname | uppercase }} </p>
</div>
You can convert strings to uppercase with this filter
In HTML Template Binding:
{{ varName | uppercase}}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With