AUR0775
Error Message
AUR0775: Invalid command "<command>" usage with [repeat]
Where <command>
is the binding command used (e.g., one-time
, from-view
).
Description
This error occurs when the repeat.for
attribute uses a binding command other than the allowed ones: bind
(two-way) or to-view
(one-way).
Cause
The repeat
template controller inherently works by observing changes in the source collection (the iterable provided to repeat.for
) and updating the generated DOM elements accordingly. This requires a one-way (to-view
) or two-way (bind
) data flow from the view model to the view.
Using other commands like one-time
would prevent the repeater from updating when the collection changes, and from-view
or two-way
don't make conceptual sense for iterating a collection from the view model. The Repeat
controller's constructor explicitly checks for and disallows unsupported commands.
Solution
Ensure that your repeat.for
binding uses either the default (which is to-view
) or explicitly uses .bind
or .to-view
.
repeat.for="item of items"
(implicitly usesto-view
)repeat.for="item of items & toView"
(explicitly usesto-view
)repeat.for="item of items & bind"
(usesbind
, thoughto-view
is usually sufficient)
Remove any unsupported binding commands like .one-time
, .from-view
, or .two-way
.
Example
<!-- Incorrect: Using one-time command -->
<div repeat.for="item of items & oneTime">${item}</div>
<!-- Incorrect: Using from-view command -->
<div repeat.for="item of items & fromView">${item}</div>
<!-- Incorrect: Using two-way command (though .bind is allowed, .two-way alias might not be) -->
<div repeat.for="item of items & twoWay">${item}</div>
<!-- Correct: Implicitly uses to-view -->
<div repeat.for="item of items">${item}</div>
<!-- Correct: Explicitly uses to-view -->
<div repeat.for="item of items & toView">${item}</div>
<!-- Correct: Uses bind -->
<div repeat.for="item of items & bind">${item}</div>
Debugging Tips
Inspect the
repeat.for
binding in your HTML template.Verify the binding command used after the expression (e.g.,
& oneTime
,& fromView
).Remove or change the command to
to-view
(or omit it) orbind
.
Last updated
Was this helpful?