Filters for convert text to camel case in Angular Js

angularjs
camelcase
filters

By using filters convert text to camel case.

angular.module('test')
.filter('TextCamelCase', function() {
  return function(input) {
    input = input || '';
    return input.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
  };
});

 

You might also like:

Check null values in JavaScript?

04-02-2019 JavaScript null check null value

Time Sorting Ascending or Descending Order in Javascript

19-07-2017 Javascript ascending order descending order

Get previous date from given date in javascript

06-03-2017 date javascript previous date

Change datepicker display format

06-03-2017 datepicker angular js

Filter for insert HTML in Angular Js

06-03-2017 filter show html angular js html