Beautifier for person names for Angular.js
{{ user.name | beautifyName }}
<!--
input: JOAO DA SILVA
output: Joao da Silva
-->
Use Bower to grab the package:
bower install syonet.nameBeautifier
Then, inject the module into your app:
angular.module( "app", [ "syonet.namebeautifier" ]);
nameBeautifier can be used in two forms in an Angular app: filter and service.
Simply use the beautifyName
filter:
{{ user.name | beautifyName }}
<!--
input: JOAO DA SILVA
output: Joao da Silva
-->
Inject the $nameBeautifier
service into your controller/service:
.controller( "MyController", function ( $nameBeautifier, user ) {
$nameBeautifier.beautify( user.name );
})
MIT