Skip to content

[components] Fix setting attributes into scoped model on component init - #438

Open
cray0000 wants to merge 1 commit into
derbyjs:masterfrom
dmapper:fix-component-arguments
Open

[components] Fix setting attributes into scoped model on component init#438
cray0000 wants to merge 1 commit into
derbyjs:masterfrom
dmapper:fix-component-arguments

Conversation

@cray0000

Copy link
Copy Markdown
Member

Related to #418
There are couple of cases when attribute's original path can not be resolved (when attribute is ParentWrapper):

  1. When passing the same attribute from one component into another, like described in attributeContext issue, parameters wrapped in ParentWrapper #418.
  2. When having some complicated argument's value, like
    <view name='payment' payload='{{ { price: 500, params: #root._page.paymentParams } }}'>

currently those kind of attributes end up being ParentWrappers inside component's model

While there is probably a solution to the 1st case, I don't think there is a simple solution to the 2nd one (it can be implemented in theory though - by automatically creating a reactive functions for this kind of argument values or something like that).
So when ParentWrapper attribute fails to resolve it's original path for creating a ref we should at least init component's model with its renderValue.

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.

1 participant