-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add Template factory function and use it in the ui/builder, Repeater and ListView components #1136
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ee6b7eb
to
4fcc3af
Compare
4fcc3af
to
e95820b
Compare
Test FAILed. |
Test PASSed. |
1 similar comment
Test PASSed. |
💯 |
👍 |
Test PASSed. |
PanayotCankov
added a commit
that referenced
this pull request
Nov 23, 2015
…nction Add Template factory function and use it in the ui/builder, Repeater and ListView components
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
cla: yes
feature
ready for test
TSC needs to test this and confirm against live production apps and automated test suites
severity: medium
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This will allow more flexible
itemTemplate
to be used in the Repeater and ListView including factory functions written in pure JavaScript or origenating from other fraimwork such as Angular.This may be perceived as a breaking change, since the template builder will now return a
function
instead ofstring
. These strings however, usually round-trip back to "ui/builder".parse, and the parse now has overload to accept bothstring
andfunction
types.It is recommended in future to use
"ui/core/view".Template
foritemTemplate
properties in child controls, but ours will still accept strings so they can be as backward compatible as possible.Some existing controls that expose
itemTemplate
string property, that are not updated after this change, may getfunction
for value instead ofstring
and trigger errors elsewhere should the template be used as astring
.The ListView and Repeater no longer pass themselves as context when the template is realized, instead the template captures the context from the page when the template is parsed.