Created
November 30, 2016 15:18
-
-
Save auxcoder/0ebc9cfcf5087f96d17bf108839177ce to your computer and use it in GitHub Desktop.
Angular filter to convert a frase/name (string input) into an acronym.
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
| (function() { | |
| 'use strict'; | |
| angular.module('someApp').filter('acronym', function(){ | |
| return function(input){ | |
| return input.split(' ').map(function(x){ return x.charAt(0)}).join('').toUpperCase(); | |
| } | |
| }); | |
| }(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment