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:

How to submit form using javascript or jquery.

16-04-2017 javascript jquery submit form

How to make an http request in node js

14-03-2017 http module node js

How to get current date and time (yyyy-mm-dd H:i:s) using javascript

09-03-2017 javascript date time

Using slice remove last two characters from given string

07-03-2017 slice remove

Change datepicker display format

06-03-2017 datepicker angular js