You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
I have a custom directive that wraps an autocomplete component - I would like to support the ng-messages directive for my component, but it appears that the autocomplete requires the element for the messages div to be inside the < md-autocomplete > element:
<md-autocomplete flex required
md-input-name="autocompleteField"
md-input-minlength="2"
md-input-maxlength="18"
md-no-cache="ctrl.noCache"
md-selected-item="ctrl.selectedItem"
md-search-text="ctrl.searchText"
md-items="item in ctrl.querySearch(ctrl.searchText)"
md-item-text="item.display"
md-floating-label="Favorite state">
<md-item-template>
<span md-highlight-text="ctrl.searchText">{{item.display}}</span>
</md-item-template>
<div ng-messages="searchForm.autocompleteField.$error" ng-if="searchForm.autocompleteField.$touched">
<div ng-message="required">You <b>must</b> have a favorite state.</div>
<div ng-message="minlength">Your entry is not long enough.</div>
<div ng-message="maxlength">Your entry is too long.</div>
</div>
</md-autocomplete>
It seems the best way for me to support ng-messages on my custom wrapper directive would be to just support transclusion for the ng-messages component, for example:
<person-lookup person="vm.person" required="true">
<div ng-messages="form.person.$error">
<div ng-message="required">You must search for a person.</div>
</div>
</person-lookup>
However, I get an error because the autocomplete directive doesn't support transclusion. Is it possible to get a change enabling this? I know it's kind of an edge case, but it would definitely improve the extensibility of the component.
The text was updated successfully, but these errors were encountered:
Somewhat related to #4495.
I have a custom directive that wraps an autocomplete component - I would like to support the ng-messages directive for my component, but it appears that the autocomplete requires the element for the messages div to be inside the < md-autocomplete > element:
It seems the best way for me to support ng-messages on my custom wrapper directive would be to just support transclusion for the ng-messages component, for example:
However, I get an error because the autocomplete directive doesn't support transclusion. Is it possible to get a change enabling this? I know it's kind of an edge case, but it would definitely improve the extensibility of the component.
The text was updated successfully, but these errors were encountered: