@angular-wave/angular.ts 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/angular-ts.esm.js +1 -1
  2. package/dist/angular-ts.umd.js +1 -1
  3. package/docs/.cspell.yml +8 -0
  4. package/docs/.github/dependabot.yml +14 -0
  5. package/docs/.nvmrc +1 -0
  6. package/docs/CONTRIBUTING.md +28 -0
  7. package/docs/Dockerfile +4 -0
  8. package/docs/LICENSE +201 -0
  9. package/docs/README.md +184 -0
  10. package/docs/assets/scss/_variables_project.scss +6 -0
  11. package/docs/config.yaml +15 -0
  12. package/docs/content/en/_index.md +77 -0
  13. package/docs/content/en/about/featured-background.jpg +0 -0
  14. package/docs/content/en/about/index.md +35 -0
  15. package/docs/content/en/blog/_index.md +8 -0
  16. package/docs/content/en/blog/news/_index.md +4 -0
  17. package/docs/content/en/blog/news/first-post/featured-sunset-get.png +0 -0
  18. package/docs/content/en/blog/news/first-post/index.md +48 -0
  19. package/docs/content/en/blog/news/second-post.md +244 -0
  20. package/docs/content/en/blog/releases/_index.md +4 -0
  21. package/docs/content/en/blog/releases/in-depth-monoliths-detailed-spec.md +244 -0
  22. package/docs/content/en/community/_index.md +6 -0
  23. package/docs/content/en/docs/_index.md +29 -0
  24. package/docs/content/en/docs/concepts/_index.md +14 -0
  25. package/docs/content/en/docs/contribution-guidelines/_index.md +79 -0
  26. package/docs/content/en/docs/examples/_index.md +13 -0
  27. package/docs/content/en/docs/getting-started/_index.md +35 -0
  28. package/docs/content/en/docs/getting-started/example-page.md +240 -0
  29. package/docs/content/en/docs/overview/_index.md +36 -0
  30. package/docs/content/en/docs/reference/_index.md +12 -0
  31. package/docs/content/en/docs/reference/parameter-reference.md +211 -0
  32. package/docs/content/en/docs/tasks/Ponycopters/_index.md +12 -0
  33. package/docs/content/en/docs/tasks/Ponycopters/configuring-ponycopters.md +238 -0
  34. package/docs/content/en/docs/tasks/Ponycopters/launching-ponycopters.md +236 -0
  35. package/docs/content/en/docs/tasks/_index.md +21 -0
  36. package/docs/content/en/docs/tasks/beds.md +237 -0
  37. package/docs/content/en/docs/tasks/porridge.md +237 -0
  38. package/docs/content/en/docs/tasks/task.md +237 -0
  39. package/docs/content/en/docs/tutorials/_index.md +13 -0
  40. package/docs/content/en/docs/tutorials/multi-bear.md +236 -0
  41. package/docs/content/en/docs/tutorials/tutorial2.md +236 -0
  42. package/docs/content/en/featured-background.jpg +0 -0
  43. package/docs/content/en/search.md +4 -0
  44. package/docs/docker-compose.yaml +13 -0
  45. package/docs/docsy.work +5 -0
  46. package/docs/docsy.work.sum +0 -0
  47. package/docs/go.mod +5 -0
  48. package/docs/go.sum +6 -0
  49. package/docs/hugo-disabled.toml +221 -0
  50. package/docs/hugo.yaml +220 -0
  51. package/docs/layouts/404.html +7 -0
  52. package/docs/layouts/_default/_markup/render-heading.html +1 -0
  53. package/docs/netlify.toml +12 -0
  54. package/docs/package.json +42 -0
  55. package/package.json +1 -1
  56. package/rollup.config.js +2 -5
  57. package/src/core/compile.js +82 -269
  58. package/src/core/compile.md +51 -16
  59. package/src/core/filter.md +23 -17
  60. package/src/core/interval.md +73 -72
  61. package/src/core/sce.js +2 -13
  62. package/src/directive/if.js +2 -7
  63. package/src/directive/repeat.js +5 -346
  64. package/src/directive/repeat.md +358 -0
  65. package/src/directive/switch.js +2 -4
  66. package/src/exts/messages.js +2 -494
  67. package/src/exts/messages.md +550 -0
  68. package/src/injector.md +30 -1
  69. package/src/jqLite.js +11 -17
  70. package/src/loader.js +0 -4
  71. package/test/binding.spec.js +24 -24
  72. package/test/jqlite.spec.js +0 -56
  73. package/test/messages/messages.spec.js +3 -5
  74. package/test/module-test.html +5 -1
  75. package/test/ng/compile.spec.js +94 -371
  76. package/test/ng/directive/form.spec.js +8 -8
  77. package/test/ng/directive/repeat.spec.js +0 -37
  78. package/test/ng/directive/switch.spec.js +2 -9
  79. package/types/jqlite.d.ts +0 -78
  80. package/dist/angular-ts.cjs.js +0 -1
@@ -0,0 +1,550 @@
1
+ /\*\*
2
+
3
+ - @ngdoc module
4
+ - @name ngMessages
5
+ - @description
6
+ -
7
+ - The `ngMessages` module provides enhanced support for displaying messages within templates
8
+ - (typically within forms or when rendering message objects that return key/value data).
9
+ - Instead of relying on JavaScript code and/or complex ng-if statements within your form template to
10
+ - show and hide error messages specific to the state of an input field, the `ngMessages` and
11
+ - `ngMessage` directives are designed to handle the complexity, inheritance and priority
12
+ - sequencing based on the order of how the messages are defined in the template.
13
+ -
14
+ - Currently, the ngMessages module only contains the code for the `ngMessages`, `ngMessagesInclude`
15
+ - `ngMessage`, `ngMessageExp` and `ngMessageDefault` directives.
16
+ -
17
+ - ## Usage
18
+ - The `ngMessages` directive allows keys in a key/value collection to be associated with a child element
19
+ - (or 'message') that will show or hide based on the truthiness of that key's value in the collection. A common use
20
+ - case for `ngMessages` is to display error messages for inputs using the `$error` object exposed by the
21
+ - {@link ngModel ngModel} directive.
22
+ -
23
+ - The child elements of the `ngMessages` directive are matched to the collection keys by a `ngMessage` or
24
+ - `ngMessageExp` directive. The value of these attributes must match a key in the collection that is provided by
25
+ - the `ngMessages` directive.
26
+ -
27
+ - Consider the following example, which illustrates a typical use case of `ngMessages`. Within the form `myForm` we
28
+ - have a text input named `myField` which is bound to the scope variable `field` using the {@link ngModel ngModel}
29
+ - directive.
30
+ -
31
+ - The `myField` field is a required input of type `email` with a maximum length of 15 characters.
32
+ -
33
+ - ```html
34
+
35
+ ```
36
+
37
+ - <form name="myForm">
38
+ - <label>
39
+ - Enter text:
40
+ - <input type="email" ng-model="field" name="myField" required maxlength="15" />
41
+ - </label>
42
+ - <div ng-messages="myForm.myField.$error" role="alert">
43
+ - <div ng-message="required">Please enter a value for this field.</div>
44
+ - <div ng-message="email">This field must be a valid email address.</div>
45
+ - <div ng-message="maxlength">This field can be at most 15 characters long.</div>
46
+ - </div>
47
+ - </form>
48
+ - ```
49
+
50
+ ```
51
+
52
+ -
53
+ - In order to show error messages corresponding to `myField` we first create an element with an `ngMessages` attribute
54
+ - set to the `$error` object owned by the `myField` input in our `myForm` form.
55
+ -
56
+ - Within this element we then create separate elements for each of the possible errors that `myField` could have.
57
+ - The `ngMessage` attribute is used to declare which element(s) will appear for which error - for example,
58
+ - setting `ng-message="required"` specifies that this particular element should be displayed when there
59
+ - is no value present for the required field `myField` (because the key `required` will be `true` in the object
60
+ - `myForm.myField.$error`).
61
+ -
62
+ - ### Message order
63
+ -
64
+ - By default, `ngMessages` will only display one message for a particular key/value collection at any time. If more
65
+ - than one message (or error) key is currently true, then which message is shown is determined by the order of messages
66
+ - in the HTML template code (messages declared first are prioritised). This mechanism means the developer does not have
67
+ - to prioritize messages using custom JavaScript code.
68
+ -
69
+ - Given the following error object for our example (which informs us that the field `myField` currently has both the
70
+ - `required` and `email` errors):
71
+ -
72
+ - ```javascript
73
+
74
+ ```
75
+
76
+ - <!-- keep in mind that ngModel automatically sets these error flags -->
77
+ - myField.$error = { required : true, email: true, maxlength: false };
78
+ - ```
79
+
80
+ ```
81
+
82
+ - The `required` message will be displayed to the user since it appears before the `email` message in the DOM.
83
+ - Once the user types a single character, the `required` message will disappear (since the field now has a value)
84
+ - but the `email` message will be visible because it is still applicable.
85
+ -
86
+ - ### Displaying multiple messages at the same time
87
+ -
88
+ - While `ngMessages` will by default only display one error element at a time, the `ng-messages-multiple` attribute can
89
+ - be applied to the `ngMessages` container element to cause it to display all applicable error messages at once:
90
+ -
91
+ - ```html
92
+
93
+ ```
94
+
95
+ - <!-- attribute-style usage -->
96
+ - <div ng-messages="myForm.myField.$error" ng-messages-multiple>...</div>
97
+ -
98
+ - <!-- element-style usage -->
99
+ - <ng-messages for="myForm.myField.$error" multiple>...</ng-messages>
100
+ - ```
101
+
102
+ ```
103
+
104
+ -
105
+ - ## Reusing and Overriding Messages
106
+ - In addition to prioritization, ngMessages also allows for including messages from a remote or an inline
107
+ - template. This allows for generic collection of messages to be reused across multiple parts of an
108
+ - application.
109
+ -
110
+ - ```html
111
+
112
+ ```
113
+
114
+ - <script type="text/ng-template" id="error-messages">
115
+ - <div ng-message="required">This field is required</div>
116
+ - <div ng-message="minlength">This field is too short</div>
117
+ - </script>
118
+ -
119
+ - <div ng-messages="myForm.myField.$error" role="alert">
120
+ - <div ng-messages-include="error-messages"></div>
121
+ - </div>
122
+ - ```
123
+
124
+ ```
125
+
126
+ -
127
+ - However, including generic messages may not be useful enough to match all input fields, therefore,
128
+ - `ngMessages` provides the ability to override messages defined in the remote template by redefining
129
+ - them within the directive container.
130
+ -
131
+ - ```html
132
+
133
+ ```
134
+
135
+ - <!-- a generic template of error messages known as "my-custom-messages" -->
136
+ - <script type="text/ng-template" id="my-custom-messages">
137
+ - <div ng-message="required">This field is required</div>
138
+ - <div ng-message="minlength">This field is too short</div>
139
+ - </script>
140
+ -
141
+ - <form name="myForm">
142
+ - <label>
143
+ - Email address
144
+ - <input type="email"
145
+ - id="email"
146
+ - name="myEmail"
147
+ - ng-model="email"
148
+ - minlength="5"
149
+ - required />
150
+ - </label>
151
+ - <!-- any ng-message elements that appear BEFORE the ng-messages-include will
152
+ - override the messages present in the ng-messages-include template -->
153
+ - <div ng-messages="myForm.myEmail.$error" role="alert">
154
+ - <!-- this required message has overridden the template message -->
155
+ - <div ng-message="required">You did not enter your email address</div>
156
+ -
157
+ - <!-- this is a brand new message and will appear last in the prioritization -->
158
+ - <div ng-message="email">Your email address is invalid</div>
159
+ -
160
+ - <!-- and here are the generic error messages -->
161
+ - <div ng-messages-include="my-custom-messages"></div>
162
+ - </div>
163
+ - </form>
164
+ - ```
165
+
166
+ ```
167
+
168
+ -
169
+ - In the example HTML code above the message that is set on required will override the corresponding
170
+ - required message defined within the remote template. Therefore, with particular input fields (such
171
+ - email addresses, date fields, autocomplete inputs, etc...), specialized error messages can be applied
172
+ - while more generic messages can be used to handle other, more general input errors.
173
+ -
174
+ - ## Dynamic Messaging
175
+ - ngMessages also supports using expressions to dynamically change key values. Using arrays and
176
+ - repeaters to list messages is also supported. This means that the code below will be able to
177
+ - fully adapt itself and display the appropriate message when any of the expression data changes:
178
+ -
179
+ - ```html
180
+
181
+ ```
182
+
183
+ - <form name="myForm">
184
+ - <label>
185
+ - Email address
186
+ - <input type="email"
187
+ - name="myEmail"
188
+ - ng-model="email"
189
+ - minlength="5"
190
+ - required />
191
+ - </label>
192
+ - <div ng-messages="myForm.myEmail.$error" role="alert">
193
+ - <div ng-message="required">You did not enter your email address</div>
194
+ - <div ng-repeat="errorMessage in errorMessages">
195
+ - <!-- use ng-message-exp for a message whose key is given by an expression -->
196
+ - <div ng-message-exp="errorMessage.type">{{ errorMessage.text }}</div>
197
+ - </div>
198
+ - </div>
199
+ - </form>
200
+ - ```
201
+
202
+ ```
203
+
204
+ -
205
+ - The `errorMessage.type` expression can be a string value or it can be an array so
206
+ - that multiple errors can be associated with a single error message:
207
+ -
208
+ - ```html
209
+
210
+ ```
211
+
212
+ - <label>
213
+ - Email address
214
+ - <input type="email"
215
+ - ng-model="data.email"
216
+ - name="myEmail"
217
+ - ng-minlength="5"
218
+ - ng-maxlength="100"
219
+ - required />
220
+ - </label>
221
+ - <div ng-messages="myForm.myEmail.$error" role="alert">
222
+ - <div ng-message-exp="'required'">You did not enter your email address</div>
223
+ - <div ng-message-exp="['minlength', 'maxlength']">
224
+ - Your email must be between 5 and 100 characters long
225
+ - </div>
226
+ - </div>
227
+ - ```
228
+
229
+ ```
230
+
231
+ -
232
+ - Feel free to use other structural directives such as ng-if and ng-switch to further control
233
+ - what messages are active and when. Be careful, if you place ng-message on the same element
234
+ - as these structural directives, AngularJS may not be able to determine if a message is active
235
+ - or not. Therefore it is best to place the ng-message on a child element of the structural
236
+ - directive.
237
+ -
238
+ - ```html
239
+
240
+ ```
241
+
242
+ - <div ng-messages="myForm.myEmail.$error" role="alert">
243
+ - <div ng-if="showRequiredError">
244
+ - <div ng-message="required">Please enter something</div>
245
+ - </div>
246
+ - </div>
247
+ - ```
248
+
249
+ ```
250
+
251
+ -
252
+ - ## Animations
253
+ - If the `ngAnimate` module is active within the application then the `ngMessages`, `ngMessage` and
254
+ - `ngMessageExp` directives will trigger animations whenever any messages are added and removed from
255
+ - the DOM by the `ngMessages` directive.
256
+ -
257
+ - Whenever the `ngMessages` directive contains one or more visible messages then the `.ng-active` CSS
258
+ - class will be added to the element. The `.ng-inactive` CSS class will be applied when there are no
259
+ - messages present. Therefore, CSS transitions and keyframes as well as JavaScript animations can
260
+ - hook into the animations whenever these classes are added/removed.
261
+ -
262
+ - Let's say that our HTML code for our messages container looks like so:
263
+ -
264
+ - ```html
265
+
266
+ ```
267
+
268
+ - <div ng-messages="myMessages" class="my-messages" role="alert">
269
+ - <div ng-message="alert" class="some-message">...</div>
270
+ - <div ng-message="fail" class="some-message">...</div>
271
+ - </div>
272
+ - ```
273
+
274
+ ```
275
+
276
+ -
277
+ - Then the CSS animation code for the message container looks like so:
278
+ -
279
+ - ```css
280
+
281
+ ```
282
+
283
+ - .my-messages {
284
+ - transition:1s linear all;
285
+ - }
286
+ - .my-messages.ng-active {
287
+ - // messages are visible
288
+ - }
289
+ - .my-messages.ng-inactive {
290
+ - // messages are hidden
291
+ - }
292
+ - ```
293
+
294
+ ```
295
+
296
+ -
297
+ - Whenever an inner message is attached (becomes visible) or removed (becomes hidden) then the enter
298
+ - and leave animation is triggered for each particular element bound to the `ngMessage` directive.
299
+ -
300
+ - Therefore, the CSS code for the inner messages looks like so:
301
+ -
302
+ - ```css
303
+
304
+ ```
305
+
306
+ - .some-message {
307
+ - transition:1s linear all;
308
+ - }
309
+ -
310
+ - .some-message.ng-enter {}
311
+ - .some-message.ng-enter.ng-enter-active {}
312
+ -
313
+ - .some-message.ng-leave {}
314
+ - .some-message.ng-leave.ng-leave-active {}
315
+ - ```
316
+
317
+ ```
318
+
319
+ -
320
+ - {@link ngAnimate See the ngAnimate docs} to learn how to use JavaScript animations or to learn
321
+ - more about ngAnimate.
322
+ -
323
+ - ## Displaying a default message
324
+ - If the ngMessages renders no inner ngMessage directive (i.e. when none of the truthy
325
+ - keys are matched by a defined message), then it will render a default message
326
+ - using the {@link ngMessageDefault} directive.
327
+ - Note that matched messages will always take precedence over unmatched messages. That means
328
+ - the default message will not be displayed when another message is matched. This is also
329
+ - true for `ng-messages-multiple`.
330
+ -
331
+ - ```html
332
+
333
+ ```
334
+
335
+ - <div ng-messages="myForm.myField.$error" role="alert">
336
+ - <div ng-message="required">This field is required</div>
337
+ - <div ng-message="minlength">This field is too short</div>
338
+ - <div ng-message-default>This field has an input error</div>
339
+ - </div>
340
+ - ```
341
+
342
+ ```
343
+
344
+ - \*/
345
+
346
+ /\*\*
347
+ _ @ngdoc directive
348
+ _ @module ngMessages
349
+ _ @name ngMessages
350
+ _ @restrict AE \*
351
+ _ @description
352
+ _ `ngMessages` is a directive that is designed to show and hide messages based on the state
353
+ _ of a key/value object that it listens on. The directive itself complements error message
354
+ _ reporting with the `ngModel` $error object (which stores a key/value state of validation errors).
355
+
356
+ -
357
+ - `ngMessages` manages the state of internal messages within its container element. The internal
358
+ - messages use the `ngMessage` directive and will be inserted/removed from the page depending
359
+ - on if they're present within the key/value object. By default, only one message will be displayed
360
+ - at a time and this depends on the prioritization of the messages within the template. (This can
361
+ - be changed by using the `ng-messages-multiple` or `multiple` attribute on the directive container.)
362
+ -
363
+ - A remote template can also be used (With {@link ngMessagesInclude}) to promote message
364
+ - reusability and messages can also be overridden.
365
+ -
366
+ - A default message can also be displayed when no `ngMessage` directive is inserted, using the
367
+ - {@link ngMessageDefault} directive.
368
+ -
369
+ - {@link module:ngMessages Click here} to learn more about `ngMessages` and `ngMessage`.
370
+ -
371
+ - @usage
372
+ - ```html
373
+
374
+ ```
375
+
376
+ - <!-- using attribute directives -->
377
+ - <ANY ng-messages="expression" role="alert">
378
+ - <ANY ng-message="stringValue">...</ANY>
379
+ - <ANY ng-message="stringValue1, stringValue2, ...">...</ANY>
380
+ - <ANY ng-message-exp="expressionValue">...</ANY>
381
+ - <ANY ng-message-default>...</ANY>
382
+ - </ANY>
383
+ -
384
+ - <!-- or by using element directives -->
385
+ - <ng-messages for="expression" role="alert">
386
+ - <ng-message when="stringValue">...</ng-message>
387
+ - <ng-message when="stringValue1, stringValue2, ...">...</ng-message>
388
+ - <ng-message when-exp="expressionValue">...</ng-message>
389
+ - <ng-message-default>...</ng-message-default>
390
+ - </ng-messages>
391
+ - ```
392
+
393
+ ```
394
+
395
+ -
396
+ - @param {string} ngMessages an AngularJS expression evaluating to a key/value object
397
+ - (this is typically the $error object on an ngModel instance).
398
+ - @param {string=} ngMessagesMultiple|multiple when set, all messages will be displayed with true
399
+ -
400
+ - @example
401
+ - <example name="ngMessages-directive" module="ngMessagesExample"
402
+ - deps="angular-messages.js"
403
+ - animations="true" fixBase="true">
404
+ - <file name="index.html">
405
+ - <form name="myForm">
406
+ - <label>
407
+ - Enter your name:
408
+ - <input type="text"
409
+ - name="myName"
410
+ - ng-model="name"
411
+ - ng-minlength="5"
412
+ - ng-maxlength="20"
413
+ - required />
414
+ - </label>
415
+ - <pre>myForm.myName.$error = {{ myForm.myName.$error | json }}</pre> \*
416
+ _ <div ng-messages="myForm.myName.$error" style="color:maroon" role="alert">
417
+ _ <div ng-message="required">You did not enter a field</div>
418
+ _ <div ng-message="minlength">Your field is too short</div>
419
+ _ <div ng-message="maxlength">Your field is too long</div>
420
+ _ <div ng-message-default>This field has an input error</div>
421
+ _ </div>
422
+ _ </form>
423
+ _ </file>
424
+ _ <file name="script.js">
425
+ _ angular.module('ngMessagesExample', ['ngMessages']);
426
+ _ </file>
427
+ _ </example>
428
+ \*/
429
+
430
+ /\*\*
431
+ _ @ngdoc directive
432
+ _ @name ngMessagesInclude
433
+ _ @restrict AE
434
+ _ @scope \*
435
+ _ @description
436
+ _ `ngMessagesInclude` is a directive with the purpose to import existing ngMessage template
437
+ _ code from a remote template and place the downloaded template code into the exact spot
438
+ _ that the ngMessagesInclude directive is placed within the ngMessages container. This allows
439
+ _ for a series of pre-defined messages to be reused and also allows for the developer to
440
+ _ determine what messages are overridden due to the placement of the ngMessagesInclude directive. \*
441
+ _ @usage
442
+ _ `html
443
+
444
+ - <!-- using attribute directives -->
445
+ - <ANY ng-messages="expression" role="alert">
446
+ - <ANY ng-messages-include="remoteTplString">...</ANY>
447
+ - </ANY>
448
+ -
449
+ - <!-- or by using element directives -->
450
+ - <ng-messages for="expression" role="alert">
451
+ - <ng-messages-include src="expressionValue1">...</ng-messages-include>
452
+ - </ng-messages>
453
+ - `\*
454
+ _ {@link module:ngMessages Click here} to learn more about`ngMessages`and`ngMessage`.
455
+ \_
456
+ _ @param {string} ngMessagesInclude|src a string value corresponding to the remote template.
457
+ _/
458
+
459
+ /\*\*
460
+ _ @ngdoc directive
461
+ _ @name ngMessage
462
+ _ @restrict AE
463
+ _ @scope
464
+ _ @priority 1
465
+ _
466
+ _ @description
467
+ _ `ngMessage` is a directive with the purpose to show and hide a particular message.
468
+ _ For `ngMessage` to operate, a parent `ngMessages` directive on a parent DOM element
469
+ _ must be situated since it determines which messages are visible based on the state
470
+ _ of the provided key/value map that `ngMessages` listens on.
471
+ _
472
+ _ More information about using `ngMessage` can be found in the
473
+ _ {@link module:ngMessages `ngMessages` module documentation}. \*
474
+ _ @usage
475
+ _ `html
476
+
477
+ - <!-- using attribute directives -->
478
+ - <ANY ng-messages="expression" role="alert">
479
+ - <ANY ng-message="stringValue">...</ANY>
480
+ - <ANY ng-message="stringValue1, stringValue2, ...">...</ANY>
481
+ - </ANY>
482
+ -
483
+ - <!-- or by using element directives -->
484
+ - <ng-messages for="expression" role="alert">
485
+ - <ng-message when="stringValue">...</ng-message>
486
+ - <ng-message when="stringValue1, stringValue2, ...">...</ng-message>
487
+ - </ng-messages>
488
+ - ` \*
489
+ _ @param {string} ngMessage|when a string value corresponding to the message key.
490
+ _/
491
+
492
+ /\*\*
493
+ _ @ngdoc directive
494
+ _ @name ngMessageExp
495
+ _ @restrict AE
496
+ _ @priority 1
497
+ _ @scope
498
+ _
499
+ _ @description
500
+ _ `ngMessageExp` is the same as {@link directive:ngMessage `ngMessage`}, but instead of a static
501
+ _ value, it accepts an expression to be evaluated for the message key.
502
+ _
503
+ _ @usage
504
+ _ `html
505
+
506
+ - <!-- using attribute directives -->
507
+ - <ANY ng-messages="expression">
508
+ - <ANY ng-message-exp="expressionValue">...</ANY>
509
+ - </ANY>
510
+ -
511
+ - <!-- or by using element directives -->
512
+ - <ng-messages for="expression">
513
+ - <ng-message when-exp="expressionValue">...</ng-message>
514
+ - </ng-messages>
515
+ - `\*
516
+ _ {@link module:ngMessages Click here} to learn more about`ngMessages`and`ngMessage`.
517
+ \_
518
+ _ @param {string} ngMessageExp|whenExp an expression value corresponding to the message key.
519
+ _/
520
+
521
+ /**
522
+ * @ngdoc directive
523
+ * @name ngMessageDefault
524
+ * @restrict AE
525
+ * @scope
526
+ *
527
+ * @description
528
+ * `ngMessageDefault` is a directive with the purpose to show and hide a default message for
529
+ * {@link directive:ngMessages}, when none of provided messages matches.
530
+ *
531
+ * More information about using `ngMessageDefault` can be found in the
532
+ * {@link module:ngMessages `ngMessages` module documentation}.
533
+ *
534
+ * @usage
535
+ * ```html
536
+ * <!-- using attribute directives -->
537
+ * <ANY ng-messages="expression" role="alert">
538
+ * <ANY ng-message="stringValue">...</ANY>
539
+ * <ANY ng-message="stringValue1, stringValue2, ...">...</ANY>
540
+ * <ANY ng-message-default>...</ANY>
541
+ * </ANY>
542
+ *
543
+ * <!-- or by using element directives -->
544
+ * <ng-messages for="expression" role="alert">
545
+ * <ng-message when="stringValue">...</ng-message>
546
+ * <ng-message when="stringValue1, stringValue2, ...">...</ng-message>
547
+ * <ng-message-default>...</ng-message-default>
548
+ * </ng-messages>
549
+ *
550
+ */