Skip to content

Commit

Permalink
Update API.md for anchor link
Browse files Browse the repository at this point in the history
  • Loading branch information
Huei Tan committed Feb 6, 2015
1 parent 8a86b03 commit 63d4849
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions API.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
API
===
**Add Valid Message (error, success) for validation `required`** <br/>
### **Add Valid Message (error, success) for validation `required`** <br/>
`required-error-message` and `required-success-message`

```html
Expand All @@ -16,7 +16,7 @@ API
-->
```

**Add Valid Message (error, success) for validation `email`** <br/>
### **Add Valid Message (error, success) for validation `email`** <br/>
`email-error-message` and `email-success-message`

```html
Expand All @@ -29,7 +29,7 @@ API
email-success-message="Good Email"/>
```

**Use Default Valid Message** <br/>
### **Use Default Valid Message** <br/>
*you don't need to give valid message*

```html
Expand All @@ -38,7 +38,7 @@ API
```

<a name="no-validation-message"></a>
**Don't show the Valid Message `no-validation-message="true"`**
### **Don't show the Valid Message `no-validation-message="true"`**

```html
<label>Number</label>
Expand All @@ -47,14 +47,14 @@ API
<input type="text" name="number" ng-model="form.number" validator="number" no-validation-message="{{ noValidationMessage }}"/>
```

**Add Valid Callback Function, `invalid-callback` & `valid-callback`**
### **Add Valid Callback Function, `invalid-callback` & `valid-callback`**

```html
<label>Required (Invalid Callback alert)</label>
<input type="text" name="requiredCallback" ng-model="form.requiredCallback" validator="required" invalid-callback='error("Must be Required");'/>
```

**Select the validation method `watch` `blur` `submit` `submit-only`, default as `watch`** <br/>
### **Select the validation method `watch` `blur` `submit` `submit-only`, default as `watch`** <br/>
`validationProvider.validate(form).success(callback).error(callback)` use callback to continue your submit

```html
Expand Down Expand Up @@ -109,7 +109,7 @@ API
<!-- Clean, right ? -->
```

**Setup a new Validation `setExpression()` `setDefaultMsg()` with `RegExp` or `Function` in config phase**
### **Setup a new Validation `setExpression()` `setDefaultMsg()` with `RegExp` or `Function` in config phase**
<a name="custom-function-huei"></a>

```html
Expand Down Expand Up @@ -161,8 +161,8 @@ angular.module('yourApp', ['validation'])
}]);
```

**Check form whether valid, return `true` if valid. `checkValid()`** <br/>
**Reset the specific Form. `reset()`**
### **Check form whether valid, return `true` if valid. `checkValid()`** <br/>
### **Reset the specific Form. `reset()`**

```html
<form name="Form">
Expand Down Expand Up @@ -192,7 +192,7 @@ angular.module('yourApp', ['validation'])
};
```

**Set the valid/invalid message style CSS**
### **Set the valid/invalid message style CSS**

```html
<span><p class="validation-valid">Your valid message here<p></span>
Expand All @@ -209,7 +209,7 @@ angular.module('yourApp', ['validation'])
}
```

**Custom the valid/invalid message style HTML in `.config()`,** <br/>
### **Custom the valid/invalid message style HTML in `.config()`,** <br/>
`setErrorHTML(func)` `setSuccessHTML(func)`, input should be a `function` and given `parameter` which is the valid/invalid message declared
in `getDefaultMsg()`,and finally return the HTML code

Expand All @@ -227,7 +227,7 @@ in `getDefaultMsg()`,and finally return the HTML code
}]);
```

**disable/enable show success/error message**<br/>
### **disable/enable show success/error message**<br/>
`default: true`<br/>
Easily disable success/error message

Expand All @@ -239,7 +239,7 @@ Easily disable success/error message
}]);
```

**multiple validators**<br/>
### **multiple validators**<br/>
use commar as splitter

```html
Expand Down

0 comments on commit 63d4849

Please sign in to comment.