Filter uppercase with ng-options
You can easily use a css approach for this by attaching a class to the
var app = angular.module('myApp', []);
app.controller('ArrayController', function ($scope) {
$scope.currency_list = [
{
code: 'eur'
}, {
code: 'usd'
}
];
});
.text-capitalize{ text-transform: capitalize }
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app='myApp' ng-controller="ArrayController">
<select
class="text-capitalize"
ng-model="company.currency.code"
ng-options="currency.code as currency.code for currency in currency_list">
</select>
</div>
Use uppercase filter.
Take a look at this
var app = angular.module('myApp', []);
app.controller('ArrayController', function ($scope) {
$scope.currency_list = [
{
code: 'eur'
}, {
code: 'usd'
}
];
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app='myApp' ng-controller="ArrayController">
<select ng-model="company.currency.code" ng-options="currency.code as (currency.code | uppercase) for currency in currency_list | uppercase">
</select>
</div>
This should work:
ng-options="currency.code as (currency.code | uppercase) for currency in currency_list"
See the filter docs: https://docs.angularjs.org/api/ng/filter/uppercase