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

https://github.com/bitnbytesio/ng-forms

Form Handler for angular js
https://github.com/bitnbytesio/ng-forms

Last synced: 9 months ago
JSON representation

Form Handler for angular js

Awesome Lists containing this project

README

          

# ng-forms
Form Handler for angular js

# Requirements

angular 1.6

** Note: for angular 1.5 switch to version 1.3 branch

# Usage

```javascript
var myApp = angular.module('myApp', ['ngRoute', 'ngForms']);
```

```javascript

$scope.form = {};

$scope.signin = $ngForm.create({

url: 'login',
method: 'post',
scope: $scope,
path: 'form',
multipart: false // optional, make it true in case of file upload

}, {

success: function (o) {

}

});

```

```html

Login to your account

{{form.response.alert.text}}



Username or Email

{{form.response.error('email')}}




Password

{{form.response.error('email')}}




Remember me


Sign in

```

**ng-forms is built especially for laravel developers**

```php

// Laravel validations
$validation = Validator::make($request->all(), $rules);

if ($validation->fails()) {
return ['success' => false, 'errors' => $validation->errors()];
}
```

**Note: dismiss function will hide alert. directly bind to some button or use in angular-ui close attribute**

**Ver:1.2**
- 2 functions added for error handling (hasError() and error() in server response object)