You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-1Lines changed: 19 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,7 @@ The following are the list of all keys that have special meaning in template obj
75
75
-[`firstOf`](#firstOf)
76
76
-[`assign`](#assign)
77
77
-[`ignoreDeep`](#ignoreDeep)
78
+
-[`paramKey`](#paramKey)
78
79
79
80
<aname="dataKey" />
80
81
#### `dataKey` rule
@@ -219,6 +220,23 @@ var r2 = j2j.run(template, {
219
220
console.log(r2); // null
220
221
```
221
222
223
+
<aname="paramKey" />
224
+
#### `paramKey` rule
225
+
226
+
This rule selects a particular property of params, which can be passed as a optional third parameter to the run function as shown below :
227
+
```js
228
+
var template = {
229
+
paramKey:'a'
230
+
};
231
+
232
+
var r0 =j2j.run(template, {}, {
233
+
a:1
234
+
});
235
+
console.log(r0); // 1
236
+
237
+
```
238
+
239
+
222
240
<aname="value" />
223
241
#### `value` rule
224
242
@@ -973,7 +991,7 @@ Each engine instance `j2j` contains all the implementation details as functions
973
991
-`actionKeys`
974
992
-`dataKeyToInput`
975
993
-`dataKeyArrayToInput`
976
-
- `context
994
+
-`context`
977
995
978
996
`run` is the entry point. `content`, `arrayContent`, `value`, `constant`, `firstOf` and `assign` are called action keys and listed in `actionKeys` array. Only one of `actionKeys` can appear on a template on the same level. None of these keys are designed to be overridden except `context`. However you can add additional functionality by adding new data and action keys.
0 commit comments