-
-
Save spsaucier/028dd17a8248cbee6239 to your computer and use it in GitHub Desktop.
FFA_SW 12
This file contains 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('capitalize', function() { | |
// Send the results of this manipulating function back to the view. | |
return function (input) { | |
// If input exists, replace the first letter of each word with its capital equivalent. | |
return (!!input) ? input.replace(/([^\W_]+[^\s-]*) */g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1)}) : ''; | |
} | |
}) | |
.filter('lastdir', function () { | |
// Send the results of this manipulating function back to the view. | |
return function (input) { | |
// Simple JS to split & slice like a fine chef. | |
return (!!input) ? input.split('/').slice(-2, -1)[0] : ''; | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment