Issue
I have condition like this
<table ng-if="name=='john' && name=='MARK'">
//rest of the code
</table>
My code will execute when ng-if is true.
Now my doubt is , ng-if should be true even when name is in both upper and lower case..
<table ng-if="name=='JOhN' && name=='maRK'">
//rest of the code
</table>
Is it possible?
I have tried this using if-else
condition also.
if(name.toString()='john'){
alert('success')
}
else{
alert('failure')
}
Is it correct?
Solution
try,
<table ng-if="name.toLowerCase()=='john' && name.toLowerCase()=='mark'">
//rest of the code
</table>
or with angular lowercase
filter
<table ng-if="(name| lowercase) =='john' && (name | lowercase)=='mark'">
//rest of the code
</table>
Answered By - Azad
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.