Polymer/old-docs-site

Properties outside the properties object

Open

#2463 aperta il 6 feb 2018

Vedi su GitHub
 (3 commenti) (0 reazioni) (0 assegnatari)HTML (2482 fork)batch import
P3docsgood first issuequestion

Metriche repository

Star
 (1013 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

From @hadriann on February 5, 2018 17:31

Description

The usage of properties outside of the properties object is not documented. From the docs:

In most cases, a property that's part of your element's public API should be declared in the properties object.

It is implied that there are use cases when you need not declare a property in the properties object.

One such use case might be a component's private property (like a config), that is set by the component itself (not received via attributes), and passed down to one of its children.

There are a few questions regarding this:

  1. Is the above scenario (or any scenario) a valid use case for outside-the-properties properties?
  2. Will basic data binding work for such properties?
  3. Will computed data binding work?
  4. Will such a property be bound at the first render (ready) of the markup?
  5. What is the best practice (Polymer-way) to declare or use such private properties?

Copied from original issue: Polymer/polymer#5093

Guida contributor