Skip to content

Parent data search #99

@paulbalomiri

Description

@paulbalomiri

Hi,

I removed the restriction of a maximum distance between parent and child form member template ( was 6, why not 42? 😄 )

See PR below.

I think that , still, there is too much magic in finding the parent template.
What would you think of a PR that does away with the nessesary context template parameter and restricts the set of templates looked at to Views which are child views of Templates registered, but not of unregistered templates

Assume a structure of blaze views is like this

  • view (== Template.view of a registered form template)
    • view (== with for example)
    • view (== unregistered Template, providing context)
    • view (== unregistered template)
      - view (== child view)

Now i'm proposing would pick the parent context child view like this

  • if standalone==true then don't go up the tree
  • if the view is a child view of a registered Template (and no other template)
    • if it is not a standalone==true Template
      • and also has a context= data member, than take that one
  • if the view is a registered Template and has a has a reactiveForms instance property
    • if it is not a standalone==true Template, take this

The docs would read sth. like this

  • The ReactiveElement takes it's context from the parent ReactiveElement
  • If you want to exclude an element from the Form context use standalone=true
  • If you want to do so for all descendants then use standalone = "recursive" [or just anything truish, except true]

Do you want to get a PR for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions