matowens / ng-notify

A simple, lightweight module for displaying notifications in your AngularJS app.
http://matowens.github.io/ng-notify
MIT License
668 stars 66 forks source link

integrate with form validation? #40

Closed theaccordance closed 2 years ago

theaccordance commented 8 years ago

More of a question than an issue, is it possible to integrate the ng-notify to work with angular form validation? Id like to keep my user notifications uniform using the module if possible.

matowens commented 8 years ago

That's a good question. How are you thinking of using the two pieces together? Showing inline validation for each specific form field while displaying a generic error message in an ng-notify notification that tells the user to correct any errors that they might see in the form?

If you were going to set something up for that use case, you could watch the validity of the form and if it ever triggered an invalid state, you could display a message.

There's an example of watching validity here where you could add your notification to: http://stackoverflow.com/questions/15899389/angularjs-directive-watch-validity