Document-level global Polymer settings can be set
by creating a Polymer
object on window before importing the Polymer
library:
<html>
<head>
<meta charset="utf-8">
<script src="components/webcomponentsjs/webcomponents-lite.js"></script>
<script>
/* this script must run before Polymer is imported */
window.Polymer = {
dom: 'shadow',
lazyRegister: true
};
</script>
<!-- import a component that relies on Polymer -->
<link rel="import" href="elements/my-app.html">
</head>
<body>
...
Settings can also be switched on the URL query string:
http://example.com/test-app/index.html?dom=shadow
Available settings are listed below.
Setting | Description |
disableUpgradeEnabled
|
When true, allows elements to be selectively marked for deferred upgrade.
This is a lightweight feature useful for performance tuning an application, giving fine-grained
control over individual element instantiation cost.
When an element is marked with the Removing the Note this feature is implemented as an attribute API only. There is no corresponding
|
dom
|
Controls how local DOM is rendered. Options:
|
lazyRegister
|
Improves startup time by allowing some some registration time activities to be deferred.
Options:
|
noUrlSettings
|
When true , Polymer settings can only be sent from a script in the page. In
other words, URL query parameters such as `?dom=shadow` will be ignored. Defaults to
false .
|
passiveTouchGestures
|
When See Gesture events for more information. |
suppressBindingNotifications
|
When true , disables notify effects when propagating data downward
through bindings. Generally these are not useful unless you are explicitly adding a binding
and a property change notification event listener on the same element:
With this binding, when the host changes the value of With If your code doesn't don't use this pattern, enabling this flag should improve data system performance. |
suppressTemplateNotifications
|
When true, suppresses dom-change and rendered-item-count events from
dom-if , dom-repeat , and dom-bind elements. Users can
opt back into dom-change events by setting the notify-dom-change
attribute (notifyDomChange: true property) on individual dom-if
and dom-repeat instances.
|
useNativeCSSProperties
|
When true , Polymer uses native custom CSS properties if the browser supports
them. Defaults to false because of Safari 9 support being buggy. See the
1.6.0 release notes
for more information.
|