FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add Template factory function and use it in the ui/builder, Repeater and ListView components by PanayotCankov · Pull Request #1136 · NativeScript/NativeScript · GitHub

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

Merged
PanayotCankov merged 2 commits into
masterfrom
cankov/template-factory-function
Nov 23, 2015
Merged

PanayotCankov merged 2 commits into
masterfrom
cankov/template-factory-function

Conversation

Copy link
Copy Markdown
Contributor

This will allow more flexible itemTemplate to be used in the Repeater and ListView including factory functions written in pure JavaScript or originating from other framework 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 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 self-assigned this Nov 23, 2015
PanayotCankov added this to the 1.6 (Under Review) milestone Nov 23, 2015
ns-bot added cla: yes and removed cla: no labels Nov 23, 2015
PanayotCankov force-pushed the cankov/template-factory-function branch from ee6b7eb to 4fcc3af Compare November 23, 2015 10:10
PanayotCankov force-pushed the cankov/template-factory-function branch from 4fcc3af to e95820b Compare November 23, 2015 10:11

ns-bot commented Nov 23, 2015

Copy link
Copy Markdown

Test FAILed.

ns-bot commented Nov 23, 2015

Copy link
Copy Markdown

Test PASSed.

1 similar comment

ns-bot commented Nov 23, 2015

Copy link
Copy Markdown

Test PASSed.

enchev commented Nov 23, 2015

Copy link
Copy Markdown
Contributor

💯

Copy link
Copy Markdown
Contributor

👍

hdeshev commented Nov 23, 2015

Copy link
Copy Markdown
Contributor

💯

ns-bot commented Nov 23, 2015

Copy link
Copy Markdown

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

lock Bot commented Aug 29, 2019

Copy link
Copy Markdown

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 Bot locked and limited conversation to collaborators Aug 29, 2019
This file contains hidden or 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
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


Back | FazBrowse Home | New Git URL