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

How to search text in string using php ?

29-10-2017 php search string search

Convert Time 24 hrs to 12 hrs format In javascript

12-03-2017 date javascript 12hrs convert

How to set or update or push the values into Object in javacript

27-02-2017 javascript set update push object

Get Unique values from array/object in javascript

19-02-2017 javascript unique remove repeated values from array