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:

Convert and download html to pdf without saving file

28-10-2018 node js convert html to pdf pdf download pdf without saving

How To Get Your Blogs Posts Using Blogger API

30-07-2017 blogger api json php

Filter for insert HTML in Angular Js

06-03-2017 filter show html angular js html

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

27-02-2017 javascript set update push object

Email validation regular expression in javascript

22-02-2017 email validation regex