Created
July 28, 2014 19:38
-
-
Save miguelbermudez/955ca6c8fe88e0fd46f7 to your computer and use it in GitHub Desktop.
Create Initials From String Filter
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
.filter('initials', function () { | |
var initialsFilter = function(input) { | |
if (input) { | |
var wordArr = input.split(' '); | |
var initials = wordArr.map(function(item) { | |
return item.substring(0,1).toUpperCase(); | |
}); | |
return initials.join('.'); | |
} | |
}; | |
return initialsFilter; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment