AUR0805
Error Message
AUR0805: Invalid scope behavior "<value>" on <au-compose />. Only "scoped" or "auto" allowed.
Where <value> is the invalid value provided to the scope-behavior attribute.
Description
This error occurs when using the <au-compose> element and providing an invalid value for the scope-behavior bindable attribute. This attribute controls how the binding context (scope) is passed to the composed component or template.
Cause
The error is caused by setting the scope-behavior attribute on an <au-compose> element to a string value other than the two allowed options:
'auto'(Default): The composed component inherits the outer scope (the scope of the template where<au-compose>is used).'scoped': The composed component receives a new scope, with thebindingContextof<au-compose>becoming the$parentscope for the composed component. Thescopeproperty of<au-compose>(if provided) is used as the binding context for the composed component.
Providing any other string (e.g., 'inherit', 'none', a typo) will result in this error.
Solution
Use Valid Values: Ensure the value provided to the
scope-behaviorattribute is either the string'auto'or the string'scoped'.Check Binding: If
scope-behavioris dynamically bound (e.g.,scope-behavior.bind="myScopeSetting"), ensure the view model property (myScopeSetting) always resolves to either'auto'or'scoped'.Use Default: If you want the default behavior (
'auto'), you can simply omit thescope-behaviorattribute.
Example
Debugging Tips
Verify the spelling of the value passed to
scope-behaviorin your template. Remember it's case-sensitive.If the value is bound, log the value of the corresponding view model property right before
<au-compose>renders.Consult the
<au-compose>documentation for a clearer understanding of how'auto'and'scoped'behaviors affect the binding context.
Last updated
Was this helpful?