javascript - SystemJS with Polymer + Elements -


in systemjs+jspm managed project, how can use polymer's elements?

i've used jspm install github:polymer/polymer install polymer, , jspm install github:polymerelements/iron-elements install iron-elements.

there seems multiple issues this:

first one, example in iron-elements.html file, imports going wrong paths: <link rel="import" href="../polymer/polymer.html"> while polymer directory named it's version (as usual jspm), the actual import should <link rel="import" href="../polymer@1.0.5/polymer.html"> in case.

second, while importing polymer files, seems bit blunt in systemjs environment place inside index.html that, including version path:

<link rel="import" href="jspm_packages/bower/polymer/polymer@1.0.5/polymer.html" /> 

is there better way have these html imports in systemjs?

third, since polymer's download options either via manual download using "cart" option or in bower, if try fetch iron-elements or paper-elements via jspm's github: repository or bower:, not download dependencies, , if add dependencies manually, import paths still wrong because of version naming of jspm.

according discussion in jspm's google group, issue

is polymer assumes bower

which kind of forces me ditch either systemjs or polymer don't want do.

however, in different discussion (of aurelia framework), rob eisenberg mentions possibility of using polymer aurelia:

you should able use polymer's paper elements. include polymer framework in page prior aurelia.

as far i've learned, aurelia using jspm, can done?

a possible solution switch requirejs, can use bower add polymer's stuff, use systemjs, , i'm not sure if work aurelia. also, keep using systemjs , jspm, , use bower polymer stuff.


update

until better answer found, temporary solution use both jspm , bower, bower used polymer.

i don't know if solved problem i've found way install polymer , components through jspm.

referring issue https://github.com/polymer/polymer/issues/1133, follow next steps:

npm install jspm-bower-endpoint jspm registry create bower jspm-bower-endpoint 

with this, able install bower packages through jspm, can jspm install nom:, able same bower.

now, install polymer , paper-elements (or other collection).

jspm install bower:polymer jspm install bower:polymerelements/paper-elements 

in last step, had small problem packaging version couldn't solve through jspm. go jspm_packages/bower/polymerelements/paper-elements@version , run

bower install 

this last step install components paper-elements.

now, attach needed element html template through:

<link rel="import" href="jspm_packages/bower/polymerelements/paper-elements@version/bower_components/paper-button/paper-button.html"> 

hope can find useful!


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -