https://github.com/alisabzevari/ngval
ASP.NET MVC validation for AngularJS
https://github.com/alisabzevari/ngval
angularjs angularjs1 aspnet-mvc validation
Last synced: 4 months ago
JSON representation
ASP.NET MVC validation for AngularJS
- Host: GitHub
- URL: https://github.com/alisabzevari/ngval
- Owner: alisabzevari
- License: mit
- Created: 2013-11-21T14:13:47.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2015-03-04T07:36:23.000Z (almost 11 years ago)
- Last Synced: 2025-10-02T03:25:51.541Z (4 months ago)
- Topics: angularjs, angularjs1, aspnet-mvc, validation
- Language: C#
- Size: 2.07 MB
- Stars: 27
- Watchers: 8
- Forks: 12
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ngval
=====
ASP.NET MVC validation for AngularJS.
## Getting Started
1.Add data anotations to your entities
```c#
public class TestEntity
{
[Required]
public string RequiredProperty { get; set; }
[StringLength(10)]
public string Length10Property { get; set; }
[Required]
[StringLength(10)]
public string MultipleValidationProperty { get; set; }
}
```
2.Reference ngval.js to your page
```html
```
3.Add ngval module to your app module dependencies
```javascript
var App = angular.module('App', ['ngval']);
```
4.Use NgValFor Html helper method to insert angularjs directives for validation. It will also add native angularjs directives. And you can use ngval object for error messages and more.
```html
u.RequiredProperty) />
{{testForm.username.ngval.hasError}}
{{err.message}}
```