angularjs - Angular Material input validation error messages -


i'm trying write app using angular-material , have form has required fields needs input validation. i've attempted following example the angular-material page under errors, when view code in browser, error messages still appear if stuff entered fields

error messages displayed on entered fields

my jade template looks this:

form(name="accountform")     div(layout="row",layout-sm="column")         md-input-container             label name             input(name="acctname",ng-model="account.name",required)             div(ng-messages="accountform.acctname.$error")                 div(ng-message="required") 

i didn't realize ng-messages separate angular module. since node project, imported angular messages using npm

npm install -s angular-messages 

then modified angular module code

var app = angular.module('myapp', ['ngmaterial', 'ngmessages']); 

... , worked!

validated fields hidden messages


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -