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: docs/edge/References.md.hbs
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -7,16 +7,16 @@ By themselves, references are useless - they must *resolve* to a *{{{createLink
7
7
8
8
The resolution algorithm looks like this:
9
9
10
-
1. Is the reference a special ref? If so, resolve with the appropriate special keypath.
10
+
1. Is the reference a special ref (starting with `@` - see <ahref="#special-refs">sepcial references below</a>)? If so, resolve with the appropriate special keypath.
11
11
2. If the reference is prefixed (`./`, `../`, `^^/`), resolve it.
12
12
3. If the current context has a matching key, then resolve with it.
13
13
4. Grab the current virtual node from the template hierarchy.
14
14
5. If there are any aliases, index, or key mapping defined that match, resolve with that keypath.
15
15
6. If this is a component and there are any matching mappings, resolve with that keypath.
16
16
7. If this node has context and there is a matching path, resolve with that keypath.
17
17
8. Otherwise, remove the innermost context from the stack. Repeat (3-7).
18
-
9. If not disabled, check to see if there's a matching Ractive instance method or property, and if so, resolve with it.
19
-
10. If the reference is still unresolved, add it to the 'pending resolution' pile. Each time potentially matching keypaths are updated, resolution will be attempted for the unresolved reference.
18
+
9. If {{{createLink'Options''resolveInstanceMembers''resolveInstanceMembers'}}} is not disabled, check to see if there's a matching Ractive instance method or property, and if so, resolve with it.
19
+
10. If the reference is still unresolved, add it to the 'pending resolution' pile, a list of unresolved keys that is registered with each model that could possibly have a matching key in the future. Each time potentially matching models are updated, resolution will be attempted for their unresolved references.
20
20
21
21
## Huh?
22
22
@@ -197,6 +197,7 @@ Sometimes you have a nested context that puts a parent completely out of reach b
197
197
That's a terribly contrived example, as reasonable scenarios tend to be considerably more complex, but it gets the point across. Within the `~/bar` context, there's no way to access the current `foos` iteration. That's where the `^^/` prefix comes in. It mirrors what the `../` prefix does with keypaths, except it operates on the context stack. Like `../` it is also stackable, so if you need to access a much higher context ancestor, you can do so e.g. `^^/^^/^^/^^/ohMy`.
198
198
199
199
## Special references
200
+
<aname="special-refs"></a>
200
201
201
202
There are a few things that can be useful to reference from the template that don't really exist in your data. For instance, the current iteration index of a repeated section. These special references can be used just like any other data reference, excepting two-way binding. Here's the list of specials and their resolutions:
0 commit comments