angularjs - can't seem to display the content of ng-message for 'required' -
i don't know why can't seem display content of ng-message 'required'. i'm new this, please excuse if i'm missing obvious!!
if try display {{studentform.fname.$error}} says blank.
btw first question on stackoverflow :)
edit: use form tag instead of md-form. seems md-form not valid tag. additionally md-auto-hide="false" might me required under ng-messages tag. see : https://github.com/angular/material/issues/6767
<div layout="row"> <div layout="column"> <md-form ng-model="student" name="studentform" flex="90%"> <div layout="column" layout-padding> <md-input-container class="md-block" flex> <label for="firstname">firstname</label> <input type="text" ng-model="student.firstname" name="fname" placeholder="firstname" required></input> </md-input-container> <div ng-messages="studentform.fname.$error" role="alert"> <div ng-message="required">required!!</div> </div> <md-datepicker name="dob" ng-model="student.dob" md-placeholder="enter dob" required valid>enter dob</md-datepicker> <div ng-messages="studentform.dob.$error" role="alert"> <div ng-message="valid">the entered value not date!</div> <div ng-message="required">this date required!</div> </div> </div> <md-button ng-click="submit()">send message</md-button> </md-form> </div> </div>
use form tag instead of md-form. seems md-form not valid tag. additionally md-auto-hide="false" might me required under ng-messages tag. see : https://github.com/angular/material/issues/6767
Comments
Post a Comment