model-errors
v2.0.2
Published
Add errors to a model.
Downloads
2
Readme
model-errors
Add errors to a model.
Getting started
npm install model-errors --save
const ModelErrors = require('model-errors')
class Post {
constructor(param) {
this.errors = new ModelErrors()
}
}
<% if (post.errors.exists) { %>
<section class="row">
<div class="col">
<div class="alert alert-danger">
<h5>
The form contains <b><%= post.errors.count %></b> errors.
</h5>
<ul>
<% for (let i=0; i < post.errors.count; i++) { %>
<li>
<%= post.errors.messages[i] %>
</li>
<% } %>
</ul>
</div>
</div>
</section>
<% } %>
Changelog
Get the project's history in CHANGELOG.md.
Maintainer
Andy Bettisworth [email protected] https://andybettisworth.com
License
This project is released under the MIT License.