Skip to content

Commit 7db0629

Browse files
committed
Add another example to calculate add-on
1 parent 378f393 commit 7db0629

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

examples/add-on/calculate.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,23 @@
55
*
66
* NOTE: This version is not in sync with the source repo as it has
77
* been modified to work with the new version of the framework in development
8-
*
8+
*
99
* @example
1010
* {
1111
* "type":"calculate",
1212
* "key":"area", // the key to COPY the RESULT to (doesn't need 'model' prefix)
1313
* "watch":["length","width"], // The KEYS to WATCH for changes
1414
* "calculate":"model.length * model.width"
1515
* }
16+
* @example
17+
* {
18+
* "type":"calculate",
19+
* "format":"number", // The format to coerce the response into, currently supports 'number' or no property defined
20+
* "key":"area", // the key to COPY the RESULT to (doesn't need 'model' prefix)
21+
* "watch":["length","width"], // The KEYS to WATCH for changes
22+
* "calculate":"model.length * model.width",
23+
* "lookup":"http://example.com/validate/{{calculated}}" // The response is copied to the key
24+
* }
1625
*/
1726
angular
1827
.module('schemaForm')

0 commit comments

Comments
 (0)