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

sql - can we replace full join with union of left and right join? why not? -

javascript - Parallax scrolling and fixed footer code causing width issues -

iOS: Performance of reloading UIImage(name:...) -