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:

Compare the Triplets | Javascript | hackerrank.com

07-05-2020 hackerrank.com

How to use request module in node js

16-03-2017 request module node js

How to convert html to pdf in Node js

12-03-2017 pdf convert html node js

Remove last two characters from given string

06-03-2017 substring javascript remove

Send Mail in Node Js

21-02-2017 node js mail npm module