Socket
Socket
Sign inDemoInstall

angular-capitalize-filter

Package Overview
Dependencies
1
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-capitalize-filter

AngularJS filter to capitalize sentences and specially team names.


Version published
Maintainers
1
Weekly downloads
398
decreased by-1.73%

Weekly downloads

Readme

Source

angular-capitalize-filter

AngularJS filter to capitalize sentences and specially team names.

Installation

You can install the filter using Bower:

$ bower install angular-capitalize-filter

Or npm:

$ npm install angular-capitalize-filter

Then you have to include it in your HTML:

<script src="bower_components/angular-capitalize-filter/capitalize.js"></script>
<script src="node_modules/angular-capitalize-filter/capitalize.js"></script>

And inject the module angular-capitalize-filter as a dependency in your application:

angular.module('webApp', ['puigcerber.capitalize']);

Usage

You can use it like any other AngularJS filter:

<p>{{ input | capitalize:format:separator }}</p>

The format and separator are optional parameters. If not specified all the words are capitalized.

Format

Available formats:

All

It capitalizes all the words of a given sentence. As it's the default format you can omit the parameter.

<p>{{ sentence | capitalize:'all' }}</p>
First

It capitalizes just the first letter of the given sentence.

<p>{{ sentence | capitalize:'first' }}</p>
Team

Specially adapted for team names, with uppercase abbreviation.

<p>{{ teamName | capitalize:'team' }}</p>

It formats the team name as CD Logroñés, FC Barcelona or Valencia CF.

Separator

By default the words in a sentence are separated by the space character. But any other character can be specified as a separator so we can humanize our output.

<p>{{ underscored_sentence | capitalize:'all':'_' }}</p>
  • camelize: AngularJS filter to convert strings to lower camel case replacing non-alphanumeric characters.
  • lowerize: AngularJS filter to convert strings to lower case replacing non-alphanumeric characters.

License

MIT © Pablo Villoslada Puigcerber

Keywords

FAQs

Last updated on 25 Feb 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc