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

angular-persian

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-persian

AngularPersian is a simple [Angular.js](http://angularjs.org) module which provides a set of useful *Angular Filters* for Persian localization.

  • 2.0.2
  • latest
  • npm
  • Socket score

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

#Build Status Dependency Status License

AngularPersian is a simple Angular.js module which provides a set of useful Angular Filters for Persian localization.

AngluarPersian uses usablica/persian.js. It also has an additional pDigitWords method which represents numbers as words.

Installation

You can install this package using bower.

bower install angular-persian

Refer all dependencies in your page in right order.

<script src="bower_components/persianjs/persian.js"></script>
<script src="bower_components/angular-persian/dist/angularpersian.js"></script>

Usage

To use this package add ngPersian as a dependency to your app module, then you can easily use the tools provided in the package.

var app = angular.module('myApp', ['ngPersian', /* Other deps ... */]);

Convert Numbers to Persian Digits

You can use pNumber filter to convert the digits to persian form :

{{ product.price | pNumber }}
<!-- e.g. Raw value: 36590, Output: ۳۶۵۹۰ -->

You can mix this filter with currency and number filters :

{{ product.price | currency | pNumber }}
{{ product.quantity | number | pNumber }}

Convert Numbers to Persian Words

You can use pDigitWords filter to convert numbers to persian words.

{{ product.price | pDigitWords }} ریال
<!-- e.g. سیصد و پنجاه هزار ریال -->

Switch Keyboard layout

You can use pSwitchKey filter to switch keyboard layouts.

{{ "لخخلمث" | pSwitchKey }}
<!-- output: google -->

Fix Persian Characters in URLs

{{ 'https://fa.wikipedia.org/wiki/%D8%B5%D9%81%D8%AD%D9%87%D9%94_%D8%A7%D8%B5%D9%84%DB%8C' | pFixURL }}
<!-- https://fa.wikipedia.org/wiki/صفحهٔ_اصلی -->

Convert Arabic characters to Persian characters

You can use pArabicNumber to fix arabic number characters and pArabicChar to fix arabic characters to persian equivalents.

{{ "علي٤2465" | pArabicNumber | pArabicChar | pNumber }}
<!-- output: علی۴۲۴۶۵ -->

FAQs

Package last updated on 24 Feb 2015

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