Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: allow binding directly to data-element #498

Merged
merged 11 commits into from
Nov 25, 2024
Merged

Conversation

g105b
Copy link
Member

@g105b g105b commented Nov 21, 2024

Previously, the data-element attribute could be added to any element, and that element would be removed if it did not have any other bind operation performed on it.

For example, on <p data-element data-bind:text="message"></p>, if there was no bind to the message key, such as bindKeyValue("message", "Hello, World!");, the element was removed.

This new functionality means that you can add a value to the data-element attribute, and it can now be bound like any data-bind attribute. For example:

<p data-element="error">There was an error</p>
function go(Binder $binder):void {
  $binder->bindKeyValue("errorMessage", true);
}

@g105b g105b linked an issue Nov 21, 2024 that may be closed by this pull request
@g105b
Copy link
Member Author

g105b commented Nov 25, 2024

@g105b g105b merged commit b469f18 into master Nov 25, 2024
5 checks passed
@g105b g105b deleted the 497-bind-element-value branch November 25, 2024 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attribute bind-element should take an optional bind-value
1 participant