Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 9a7431c

Browse files
Narretzpetebacondarwin
authored andcommitted
docs(ngMessageFormat): move docs for $$messageFormat to module namespace.
This is a private service that should not be documented. The docs have been moved to the ngMessageFormat module namespace. Closes #14770
1 parent a82a62e commit 9a7431c

File tree

1 file changed

+24
-22
lines changed

1 file changed

+24
-22
lines changed

src/ngMessageFormat/messageFormatService.js

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,30 @@
1010
/* global stringify: false */
1111

1212
/**
13-
* @ngdoc service
14-
* @name $$messageFormat
13+
* @ngdoc module
14+
* @name ngMessageFormat
15+
* @packageName angular-message-format
1516
*
1617
* @description
17-
* Angular internal service to recognize MessageFormat extensions in interpolation expressions.
18-
* For more information, see:
19-
* https://docs.google.com/a/google.com/document/d/1pbtW2yvtmFBikfRrJd8VAsabiFkKezmYZ_PbgdjQOVU/edit
2018
*
21-
* @example
22-
* ## Gender
19+
* ## What is ngMessageFormat?
20+
*
21+
* The ngMessageFormat module extends the Angular {@link ng.$interpolate `$interpolate`} service
22+
* with a syntax for handling pluralization and gender specific messages, which is based on the
23+
* [ICU MessageFormat syntax][ICU].
24+
*
25+
* See [the design doc][ngMessageFormat doc] for more information.
26+
*
27+
* [ICU]: http://userguide.icu-project.org/formatparse/messages#TOC-MessageFormat
28+
* [ngMessageFormat doc]: https://docs.google.com/a/google.com/document/d/1pbtW2yvtmFBikfRrJd8VAsabiFkKezmYZ_PbgdjQOVU/edit
29+
*
30+
* ## Examples
31+
*
32+
* ### Gender
2333
*
2434
* This example uses the "select" keyword to specify the message based on gender.
2535
*
26-
* <example name="ngMessageFormat-example-gender" module="msgFmtExample" deps="angular-message-format.min.js">
36+
* <example name="ngMessageFormat-example-gender" module="msgFmtExample" deps="angular-message-format.js">
2737
* <file name="index.html">
2838
* <div ng-controller="AppController">
2939
* Select Recipient:<br>
@@ -54,8 +64,7 @@
5464
* </file>
5565
* </example>
5666
*
57-
* @example
58-
* ## Plural
67+
* ### Plural
5968
*
6069
* This example shows how the "plural" keyword is used to account for a variable number of entities.
6170
* The "#" variable holds the current number and can be embedded in the message.
@@ -64,7 +73,7 @@
6473
*
6574
* The example also shows the "offset" keyword, which allows you to offset the value of the "#" variable.
6675
*
67-
* <example name="ngMessageFormat-example-plural" module="msgFmtExample" deps="angular-message-format.min.js">
76+
* <example name="ngMessageFormat-example-plural" module="msgFmtExample" deps="angular-message-format.js">
6877
* <file name="index.html">
6978
* <div ng-controller="AppController">
7079
Select recipients:<br>
@@ -128,12 +137,11 @@
128137
* </file>
129138
* </example>
130139
*
131-
* @example
132-
* ## Plural and Gender
140+
* ### Plural and Gender together
133141
*
134142
* This example shows how you can specify gender rules for specific plural matches - in this case,
135143
* =1 is special cased for gender.
136-
* <example name="ngMessageFormat-example-plural-gender" module="msgFmtExample" deps="angular-message-format.min.js">
144+
* <example name="ngMessageFormat-example-plural-gender" module="msgFmtExample" deps="angular-message-format.js">
137145
* <file name="index.html">
138146
* <div ng-controller="AppController">
139147
Select recipients:<br>
@@ -170,6 +178,7 @@
170178
* </file>
171179
</example>
172180
*/
181+
173182
var $$MessageFormatFactory = ['$parse', '$locale', '$sce', '$exceptionHandler', function $$messageFormat(
174183
$parse, $locale, $sce, $exceptionHandler) {
175184

@@ -207,15 +216,8 @@ var $$interpolateDecorator = ['$$messageFormat', '$delegate', function $$interpo
207216
return interpolate;
208217
}];
209218

210-
211-
/**
212-
* @ngdoc module
213-
* @name ngMessageFormat
214-
* @packageName angular-message-format
215-
* @description
216-
*/
217219
var module = window['angular']['module']('ngMessageFormat', ['ng']);
218220
module['factory']('$$messageFormat', $$MessageFormatFactory);
219221
module['config'](['$provide', function($provide) {
220222
$provide['decorator']('$interpolate', $$interpolateDecorator);
221-
}]);
223+
}]);

0 commit comments

Comments
 (0)