An open API service indexing awesome lists of open source software.

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

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}}



```