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
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!
Comments
Post a Comment