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:

Using slice remove last two characters from given string

07-03-2017 slice remove

Remove last two characters from given string

06-03-2017 substring javascript remove

How to find Angular Errors

06-03-2017 errors angularjs exceptionHandler

Filter for replace text in Angular Js

05-03-2017 filter replace angular js

Get Unique values from array/object in javascript

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