angularjs - md Select required -


i'm trying load mddialog setting parameter (product in case), , when loads (md selects included) says fields required, , doesn't stop until change option.

the code :

<md-input-container class="md-block" flex-gt-sm style="min-width: 150px;">                     <label>expiration type</label>                     <md-select name="expirationtype" placeholder="expiration" ng-model="product.expirationtype" ng-required='product.name'>                         <md-option value="1">only expiry date</md-option>                         <md-option value="2">only shelflife</md-option>                         <md-option value="3">expiry date & shelflife</md-option>                         <md-option value="4">non expirable</md-option>                     </md-select>                     <div ng-messages="productform.expirationtype.$error" role="alert">                         <div ng-message="required">you must supply value.</div>                     </div>                 </md-input-container> 

and js :

   function editdialogcontroller($scope, $mddialog, $mdtoast, $log, $http, manufacturers, product) {           $scope.product = product; 

(edit) i'm guessing has ng-pristine or ng-dirty attributes, in similar case when change product through function(activated button), material considers element changed, it's valid. there way launch function after mddialog loaded?


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

c# SetCompatibleTextRenderingDefault must be called before the first -