benjamincharity
9/21/2016 - 5:07 PM

Angular sentence case filter using Lodash capitalize.

Angular sentence case filter using Lodash capitalize.

import capitalize from 'lodash/capitalize';

const lodash = {
    capitalize: capitalize,
};

export function SentenceCaseFilter() {
    'ngInject';

    return sentenceCase;


    /**
     * Sentence case a string
     *
     * @param {String} input
     * @return {String} output
     */
    function sentenceCase(input) {
        return lodash.capitalize(input);
    }

}