This repository has been archived by the owner on May 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(pluralizeFilter): Converted to Javascript
- Loading branch information
1 parent
8942398
commit c3b5cf7
Showing
2 changed files
with
22 additions
and
19 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* @chalk overview | ||
* @name Pluralize | ||
* @description | ||
* Pluralizes the given string. It's a simple proxy to the pluralize function on util. | ||
* | ||
* @param {String} string Noun to pluralize | ||
* @param {Integer} count The numer of objects | ||
* @param {Boolean} includeCount To include the number in formatted string | ||
* @returns {String} Formatted plural | ||
*/ | ||
|
||
angular.module('Mac').filter('pluralize', ['util', function(util) { | ||
return function(string, count, includeCount) { | ||
// Default includeCount to true | ||
if (includeCount === undefined) { | ||
includeCount = true; | ||
} | ||
|
||
return util.pluralize(string, count, includeCount); | ||
}; | ||
}]); |