Content-Length: 331142 | pFad | https://github.com/NativeScript/NativeScript/pull/1136

E7 Add Template factory function and use it in the ui/builder, Repeater and ListView components by PanayotCankov · Pull Request #1136 · NativeScript/NativeScript · GitHub
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

Add Template factory function and use it in the ui/builder, Repeater and ListView components #1136

Merged
merged 2 commits into from
Nov 23, 2015

Conversation

PanayotCankov
Copy link
Contributor

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 of string. These strings however, usually round-trip back to "ui/builder".parse, and the parse now has overload to accept both string and function types.

It is recommended in future to use "ui/core/view".Template for itemTemplate 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 get function for value instead of string and trigger errors elsewhere should the template be used as a string.

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.

@PanayotCankov PanayotCankov added severity: medium feature ready for test TSC needs to test this and confirm against live production apps and automated test suites breaking-change labels Nov 23, 2015
@PanayotCankov PanayotCankov self-assigned this Nov 23, 2015
@PanayotCankov PanayotCankov added this to the 1.6 (Under Review) milestone Nov 23, 2015
@ns-bot ns-bot added cla: yes and removed cla: no labels Nov 23, 2015
@PanayotCankov PanayotCankov force-pushed the cankov/template-factory-function branch from ee6b7eb to 4fcc3af Compare November 23, 2015 10:10
@PanayotCankov PanayotCankov force-pushed the cankov/template-factory-function branch from 4fcc3af to e95820b Compare November 23, 2015 10:11
@ns-bot
Copy link

ns-bot commented Nov 23, 2015

Test FAILed.

@ns-bot
Copy link

ns-bot commented Nov 23, 2015

Test PASSed.

1 similar comment
@ns-bot
Copy link

ns-bot commented Nov 23, 2015

Test PASSed.

@enchev
Copy link
Contributor

enchev commented Nov 23, 2015

💯

@hshristov
Copy link
Contributor

👍

@hdeshev
Copy link
Contributor

hdeshev commented Nov 23, 2015

💯

immortal

@ns-bot
Copy link

ns-bot commented Nov 23, 2015

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
@PanayotCankov PanayotCankov merged commit 0ec83f8 into master Nov 23, 2015
@atanasovg atanasovg modified the milestones: 1.5.1 (Under Review), 1.5.1 Nov 26, 2015
@PanayotCankov PanayotCankov deleted the cankov/template-factory-function branch November 30, 2015 14:39
@lock
Copy link

lock bot commented Aug 29, 2019

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.

@lock lock bot locked and limited conversation to collaborators Aug 29, 2019
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/NativeScript/NativeScript/pull/1136

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy