Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ng-filters

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-filters

Useful filters for AngularJS

  • 1.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
209
decreased by-18.68%
Maintainers
1
Weekly downloads
 
Created
Source

ng-filters

Bower version Slack Status Donate

Useful filters for AngularJS

Install

bower install ng-filters --save-dev

Usage

###bytes Prints a number in a friendly byte representation

{{1536 | bytes}}
{{'1536' | bytes}}
{{1536 | bytes:2}}

Result:
1.5 kB
1.5 kB
1.50 kB

###join Joins an array into a string

{{[1, 2] | join}}
{{[1, null, 2, undefined] | join}}
{{[1, 2] | join:', '}}

Result:
1,2
1,2
1, 2

###percentage Returns a number formatted as a percentage. Numbers between 0 and 1 will be rounded up to 10th decimal place.

{{123 | percentage}}
{{null | percentage}}
{{60.0 | percentage}}
{{0 | percentage}}
{{0.000001 | percentage}}
{{100.000001 | percentage:100}}

Result:
123%
0%
60%
0%
0.1%
100%

###replace Replaces string content

{{'blake' | replace:'b':'B'}}

Result:
Blake

###reverse Reverses as string or array

{{'blake' | reverse}}
{{[1, 2] | reverse}}

Result:
ekalb
[2, 1]

###toSpacedWords Splits a single word into multiple words

{{'blake' | toSpacedWords}}
{{'blakeIsAwesome' | toSpacedWords}}

Result:
Blake
Blake Is Awesome

Acknowledgements

I used Restangular as a template for this project as no one has yet to create a project template for new projects. The bytes filter originated from Thom Seddon before some improvements were made.

Keywords

FAQs

Package last updated on 26 Sep 2016

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc