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
- Host: GitHub
- URL: https://github.com/bitnbytesio/ng-forms
- Owner: bitnbytesio
- Created: 2016-05-31T07:06:16.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-06-30T08:52:34.000Z (almost 9 years ago)
- Last Synced: 2025-05-05T14:54:06.979Z (about 1 year ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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)