I have a service that retrieves data from a JSON file.
Some of the data within the data is all in uppercase, for example:
$scope.FootballClubs = [{
CompanyName: [MANCHESTER UNITED, LIVERPOOL FOOTBALL CLUB, CHELSEA, WIGAN UNTIED, LEICESTER CITY]
}];
And in my HTML, i am simply throwing about the above:
<div ng-repeat="name in FootballClubs">
{{ name.CompanyName }}
</div>
Which throws out:
MANCHESTER UNITED
LIVERPOOL FOOTBALL CLUB
CHELSEA
WIGAN UNTIED
LEICESTER CITY
What i am trying to display is:
Manchester United
Liverpool Football Club
Chelsea
Wigan United
Leicester City
A filter is an ideal solution for this purpose
So the filter itself would be
Let me offer a non-directive way which is probably easier to implement but less powerful and dependent on the solution being UI only. First, change them to lowercase
{{name.CompanyName.toLowerCase()}}
I think the easiest way is to just have CSS format it (either via a style tag, class, etc).
Here is a demo: http://plnkr.co/edit/S4xtIRApMjKe0yQGREq5?p=preview
just use this div in your HTML