-
Notifications
You must be signed in to change notification settings - Fork 27.5k
feat(ngMessages): add support for default message #12213
Conversation
Added support for showing default message when no values are mapped with ng-message. Closes angular#12008
it looks like this PR adds quite a few of duplicated code. Before doing a proper review, would it be possible to try to keep the core a little bit more DRY? |
I will make the modifications soon. |
Added a new param (boolean, isDefault) to the factory ngMessageDirectiveFactory, in order to reuse code in ngMessageDefault directive. Closes angular#12008
This looks reasonable let's get it into 1.6 early as soon as 1.5.0 is released. |
Any updates on this making it into 1.6? |
* <div ng-messages="myForm.myField.$error" role="alert"> | ||
* <div ng-message="required">This field is required</div> | ||
* <div ng-message="minlength">This field is too short</div> | ||
* <div ng-message-default>This is a default message</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use a more meaningful message here to give a better impression of how to use the directive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anything in specific that should be mentioned here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anything that you would use in an actual app. In this case, since these seem to be validation messages, the default message would be something like 'Valid' or a checkmark or 'This field is valid` etc.
A few more tests would be nice (e.g. using |
Hi @gkalpak, @mikeycgto, thanks to follow this feature request. Do we need anything else to include the feature in the 1.6 release? |
Added support for showing default message when no values are mapped with ng-message.
Closes #12008