Created
November 6, 2014 10:59
-
-
Save yllieth/e16ed2d35deab6f47eec to your computer and use it in GitHub Desktop.
Angular filter to extract extension from a file
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
angular.module('tools.filter') | |
.filter('extension', function() { | |
return function(input) { | |
return input.split('.').pop() | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage :
{{ filename | extension }}