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:

Sanitization in java sript

14-03-2017 sanitization java script

Remove last two characters from given string

06-03-2017 substring javascript remove

Get previous date from given date in javascript

06-03-2017 date javascript previous date

Navigate to another page using java script

06-03-2017 javascript redirection navigation

Email validation regular expression in javascript

22-02-2017 email validation regex