<md-select>替代方式

时间:2018-09-17 09:14:04

标签: angularjs-material

这是我的替代解决方案,适用于所需的md-select错误。我分享此简短代码只是为了满足所需的验证等。我希望这对您有所帮助,对于混乱的帖子。编码愉快。.

<md-input-container>
    <label>Program</label>
    <md-select ng-model="form.PROGRAMID" ng-change="form.ACADEMICID=null;" required>
        <md-option></md-option>
        <md-option ng-repeat="(key,l) in list_program" ng-value="l.ID"  ng-bind="l.PROGRAMLEVEL"></md-option>
    </md-select>
    <input ng-model="form.PROGRAMID" name="PROGRAMID" class="hide-field" required>
    <div ng-messages="fform.PROGRAMID.$error" ng-hide="showHints"><div ng-message="required">Required</div></div>
</md-input-container>

<style>
 md-input-container .hide-field{ position: absolute;top: 0; z-index: -1;}
</style>

0 个答案:

没有答案