Skip to content

Instantly share code, notes, and snippets.

@ianscrivener
Forked from marufsiddiqui/app.js
Last active December 23, 2015 14:29
Show Gist options
  • Save ianscrivener/6649204 to your computer and use it in GitHub Desktop.
Save ianscrivener/6649204 to your computer and use it in GitHub Desktop.
var homeModule = angular.module('HomeModule', []);
homeModule.filter('titleCase', function () {
return function (input) {
var words = input.split(' ');
for (var i = 0; i < words.length; i++) {
words[i] = words[i].charAt(0).toUpperCase() + words[i].slice(1);
}
return words.join(' ');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment