Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Aurelia bindings processing order

Can I expect bindings on a page to be processed with the particular order? For example, in this Gist binding behavior is bound first and the custom attribute second even though it "appears" earlier in markup.

<form my-attribute.bind="attrValue">
    <input value.bind="stringValue & myBehavior" />
</form>
like image 386
Maxim Balaganskiy Avatar asked Aug 02 '26 04:08

Maxim Balaganskiy


1 Answers

No, you cannot rely on the order. The markup is parsed by the browser's HTML parser, resulting in a DOM tree that is inspected by Aurelia's view compiler. Aurelia's view compiler sees the attributes in the order they appear in the DOM (eg element.attributes).

Some DOM implementations store attributes in alphabetical order. Others store them in the order they appear in the markup.

like image 152
Jeremy Danyow Avatar answered Aug 03 '26 16:08

Jeremy Danyow



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!