<md-dialog aria-label="Save to collection" ng-cloak>
- <form name="saveReqForm">
+ <form name="dialog.saveReqForm">
<md-toolbar>
<div class="md-toolbar-tools">
<h2>{{( dialog.duplicate ? 'YANGMAN_REQS_DUPLICATE' : 'YANGMAN_REQS_SAVE_TO_COL')| translate}}</h2>
</md-toolbar>
<md-dialog-content style="width: 400px;">
<div class="md-dialog-content" layout="column">
- <md-autocomplete
- md-selected-item="dialog.selectedItem"
- md-search-text="dialog.collectionName"
- md-items="item in dialog.getColAutocomplete()"
- md-floating-label="{{'YANGMAN_CREATING_COLLECTION'|translate}}"
- md-item-text="item"
- md-min-length="0">
- <md-item-template>
- <span md-highlight-text="dialog.collectionName" md-highlight-flags="^i">{{item}}</span>
- </md-item-template>
- <md-not-found>
+ <md-input-container>
+ <md-autocomplete
+ md-selected-item="dialog.selectedItem"
+ md-search-text="dialog.collectionName"
+ md-items="item in dialog.getColAutocomplete()"
+ md-floating-label="{{'YANGMAN_CREATING_COLLECTION'|translate}}"
+ md-item-text="item"
+ md-min-length="0"
+ ng-required="true">
+ <md-item-template>
+ <span md-highlight-text="dialog.collectionName" md-highlight-flags="^i">{{item}}</span>
+ </md-item-template>
+ <md-not-found>
<span ng-if="dialog.collectionName.length">
{{'YANGMAN_COLLECTION_NEW_COL_'| translate}} "{{dialog.collectionName}}" {{'YANGMAN_COLLECTION_WILL_BE_CREATED'| translate}}.
</span>
<span ng-if="dialog.collectionName.length === 0">
{{'YANGMAN_NO_COLLECTIONS'| translate}}
</span>
- </md-not-found>
- </md-autocomplete>
- <div ng-messages="saveReqForm.collectionName.$error" multiple md-auto-hide="false">
- <div ng-message="required">
- {{'YANGMAN_COLLECTION_NAME_REQUIRED'| translate}}
+ </md-not-found>
+ </md-autocomplete>
+ <input name="collectionName"
+ ng-model="dialog.collectionName"
+ ng-required="true" style="display: none;">
+ <div ng-messages="dialog.saveReqForm.collectionName.$error" multiple md-auto-hide="false">
+ <div ng-message="required">
+ {{'YANGMAN_COLLECTION_NAME_REQUIRED'| translate}}
+ </div>
</div>
- </div>
+ </md-input-container>
+
</div>
</md-dialog-content>
<md-dialog-actions layout="row">
<md-button ng-click="dialog.cancel()">
{{'YANGMAN_CANCEL'| translate}}
</md-button>
- <md-button ng-click="dialog.save()" ng-disabled="dialog.collectionName.length === 0">
+ <md-button ng-click="dialog.save()" ng-disabled="!dialog.saveReqForm.$valid">
{{'YANGMAN_SAVE'| translate}}
</md-button>
</md-dialog-actions>