# ng-pluralize-html

> Module that extends ng-pluralize directive to support HTML

Latest version **1.0.1** (published 2018-03-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install ng-pluralize-html
pnpm add ng-pluralize-html
yarn add ng-pluralize-html
bun add ng-pluralize-html
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-03-21 |
| First published | 2018-03-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 18.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | christianesperar@gmail.com |
| Maintainers | christianesperar |
| Keywords | angularjs, ng-pluralize |

## Links

- npm: https://www.npmjs.com/package/ng-pluralize-html
- Repository: https://github.com/christianesperar/ng-pluralize-html
- Homepage: https://github.com/christianesperar/ng-pluralize-html#readme
- Issues: https://github.com/christianesperar/ng-pluralize-html/issues
- npm.io page: https://npm.io/package/ng-pluralize-html

## Recent versions

- 1.0.1 (latest) — 2018-03-21
- 1.0.0 — 2018-03-20

## README

# ng-pluralize-html [![Build Status](https://travis-ci.org/christianesperar/ng-pluralize-html.svg?branch=master)](https://travis-ci.org/christianesperar/ng-pluralize-html)
A module that extends ng-pluralize directive to support HTML which is a missing feature and a required functionality to some developers based on [this](https://github.com/angular/angular.js/issues/4790) **open issue on AngularJs repository**.

It has exactly the same API functionality, just change **ng-pluralize** to **ng-pluralize-html**.

API documentation can be found [here](https://docs.angularjs.org/api/ng/directive/ngPluralize).

## Usage
### Install
#### Bower
    bower install ng-pluralize-html --save
#### npm
    npm install ng-pluralize-html --save
#### yarn
    yarn add ng-pluralize-html --save
### Example
Click [here](https://rawgit.com/christianesperar/ng-pluralize-html/master/example/github.html) to see it in action.

#### JS
```javascript
// Declare the dependency module
var sampleApp = angular.module('ngPluralizeHtmlSample', ['ngPluralizeHtml']);

// Use it like ng-pluralize
sampleApp.controller('NgPluralizeHtmlController', ['$scope', function NgPluralizeHtmlController($scope){
  $scope.person1 = 'Igor';
  $scope.person2 = 'Misko';
  $scope.personCount = 1;
}]);
```

#### HTML
```html
<div ng-app="ngPluralizeHtmlSample">
  <h1>Using ng-pluralize-html</h1>
  <div ng-controller="NgPluralizeHtmlController">
    <label>Person 1:<input type="text" ng-model="person1" value="Igor"/></label><br/>
    <label>Person 2:<input type="text" ng-model="person2" value="Misko"/></label><br/>
    <label>Number of People:<input type="text" ng-model="personCount" value="1"/></label><br/>

    <!-- Example with simple pluralization rules for en locale -->
    Without Offset:
    <ng-pluralize-html
      count="personCount"
      when="{
        '0': '<strong>Nobody</strong> is viewing.',
        'one': '<strong>1</strong> person is viewing.',
        'other': '<strong>{}</strong> people are viewing.'
      }">
    </ng-pluralize-html>

    <br>

    <!-- Example with offset -->
    With Offset(2):
    <ng-pluralize-html
      count="personCount"
      offset="2"
      when="{'0': '<strong>Nobody</strong> is viewing.',
        '1': '<strong>{{person1}}</strong> is viewing.',
        '2': '<strong>{{person1}} and {{person2}}</strong> are viewing.',
        'one': '<strong>{{person1}}, {{person2}} and one</strong> other person are viewing.',
        'other': '<strong>{{person1}}, {{person2}} and {}</strong> other people are viewing.'
      }">
    </ng-pluralize-html>
  </div>
</div>
```

---
_Source: https://npm.io/package/ng-pluralize-html · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
