Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ng-milk/angular-capitalize-filter

Angular filter that capitalizes each word in a string, quick demo here: http://ng-milk.github.io/angular-capitalize-filter/
https://github.com/ng-milk/angular-capitalize-filter

angular-filter angularjs javascript

Last synced: 3 months ago
JSON representation

Angular filter that capitalizes each word in a string, quick demo here: http://ng-milk.github.io/angular-capitalize-filter/

Awesome Lists containing this project

README

        

# Angular capitalize filter

### [Quick Demo](http://ng-milk.github.io/angular-capitalize-filter/)
Angular filter that capitalizes each word in a string, read about it on [here](https://ngmilk.rocks/2015/04/03/angularjs-filter-that-capitalizes-each-word-in-a-string/).
CSS is fairly powerful, but it can only capitalize words that aren't uppercase. The `text-transform:capitalize` property won't change anything in a string like **CAN'T GET ME CSS**. Use this directive to achieve consistent capitalization of each word in a given string.

## Usage
1. Include `ng-capitalize.js`.
2. Add `dm.capitalize` as a dependency to your app.
3. Profit!

## Bower
Installable via `bower`:

```bash
bower install ng-capitalize
```

## Npm
Installable via `npm`:

```bash
npm install ng-capitalize-filter --save
```

## Example
See [index.html](https://github.com/ng-milk/angular-capitalize-filter/blob/master/index.html) for an example.

```html

angular.module('app', ['dm.capitalize']);


  • {{'MOUNTAIN' | capitalize}}

  • {{'MOUNTAIN DOOM' | capitalize}}


```

## About ngmilk

**ngmilk** is the place to go for fresh front-end articles, with a focus on AngularJS.
See more on [ngmilk.rocks](https://ngmilk.rocks)

Follow [@ngmilkrocks](http://twitter.com/ngmilkrocks) on Twitter to stay ahead of the game.