Polymer 1.0 imports all items at once

I started blocking in the new Google Polymer SDK, now that I’ve started to study, I asked myself if all the elements of the paper group can be turned on right away? Otherwise, my header will be larger than my actual body code ...

<link rel="import" href="bower_components/paper-toolbar/paper-toolbar.html">
+4
source share
3 answers

There are several ways to achieve this that can be used in combination with each other.

Import entire collections of items

As several commentators noted, this proposal no longer works. Currently, PR is open in the repositoryiron-elements , which will allow using this function. If this is what you find useful, then I suggest leaving a support comment (+1).

/ paper-elements iron-elements , HTML- . :

<link rel="import" href="bower_components/iron-elements/iron-elements.html">
<link rel="import" href="bower_components/paper-elements/paper-elements.html">

, , , . , , , .

- HTML HTML-, , . , . , :

<link rel="import" href="bower_components/paper-input/paper-input.html">
<link rel="import" href="bower_components/paper-toolbar/paper-toolbar.html">
<link rel="import" href="bower_components/iron-a11y-keys/iron-a11y-keys.html">
<link rel="import" href="bower_components/some-other-component/some-other-component.html">

, , :

<link rel="import" href="common_elements.html">

Google , , . , . , , , .

, https://github.com/polymer/vulcanize

+5
0

I had the same problem, and as others have pointed out, you can create one import file. I have created a script that automates this process, and you may be interested, like others facing the same problem. It automatically creates an import file from elements of the working directory. =)

https://gist.github.com/draganmarjanovic/0bef6c298da767bf38b1

0
source

All Articles