AngularJS filter for capitalization of sentences or words.
Use bower
to install it:
bower install angular-capitalize
Add a dependency on ehFilters
to your Angular module:
angular.module('awesome', ['ehFilters']);
Include the module, e.g.:
<script src="angular-capitalize.js"></script>
Include locale file if you need:
<script src="angular-capitalize-locale_pt-br.js"></script>
Filter things:
{{ 'Some string' | capitalize }}
or {{ 'random string' | capitalize:'firstChar' }}
or any other method.
Uppercases the first char of the string. Does not change the rest.
Uppercases first char for each word in the string.
Uppcases the first char of the string, lowercases the rest.
Lowercases the whole string.
Uses John Gruber and John Resig method of capitalizing a title.