vim-zz / change-case

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change Case

Bower version

Convert strings between camelCase, PascalCase, Title Case, snake_case, param-case, lowercase, UPPERCASE, CONSTANT_CASE and more.

Attention

This is a fork of blakeembrey/change-case created specifically to add support for bower, angular and just dropping script on the page. If you are interested in NPM package and want to use it either in Node.js environment or with Browserify - please visit original package's page. If you are looking for documentation or want to submit an issue which is not specific to in-browser usage please proceed to aforementioned page as well.

Usage

Installation

bower install change-case --save

Or just include ./dist/change-case.js script on your page.

Angular

If you use angular than you than have to include module 'change-case' in your module's dependencies:

angular.module('yourApp', ['change-case'])

Now you can use changeCase service like that:

angular.module('yourApp').controller('yourController',
  function($scope, changeCase)
    <...>
    $scope.paramCaseString = changeCase.paramCase('TestString');
    //$scope.paramCaseString will equal 'test-string'
  })

Not angular

Global variable changeCase will be available for your use.

var paramCaseString = changeCase.paramCase('TestString');
//paramCaseString will equal 'test-string'

About

License:MIT License


Languages

Language:JavaScript 100.0%