Last active
March 3, 2016 22:11
-
-
Save bbrown/d22c6dfce869d32778d0 to your computer and use it in GitHub Desktop.
Angular filter to do a naive title case of a string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module("app").filter("titleCase", function() | |
| { | |
| return function(input) | |
| { | |
| return (input && input.charAt(0).toUpperCase() + input.substr(1).toLowerCase()); | |
| }; | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment