Concatenation of the polymer chain to repeat the pattern in version 1.0

I am not sure if the following is possible using the "calculated" and dom-repeat pattern. I contacted child and parent properties before .9 / .8 / 1.0

<template is="dom-repeat" as="agreementTypeCount" index-as="agreementTypeCountI" items="{{agreementTypeCounts}}"> <a href="/{{style_domain}}/agreements/#/table/country/{{selectedCountryCode}}/type/{{agreementTypeCount.type}}/sort/start-desc/size/10/page/1/">{{agreementTypeCount.type}}</a> </template> 

Are there any plans to implement string concatenation? It would make life so much easier!

+5
source share
1 answer

It is currently on the roadmap. However, you can also use calculated bindings for this.

 <template is="dom-repeat" as="agreementTypeCount" index-as="agreementTypeCountI" items="{{agreementTypeCounts}}"> <a href$="{{computeAgreementUrl(style_domain, selectedCountryCode, agreementTypeCount.type)}}">{{agreementTypeCount.type}}</a> </template> 

and then declare it

 Polymer({ ... computeAgreementUrl(styleDomain, countryCode, type){ return "/"+styleDomain+"/agreements/#/table/country/"+countryCode+"/type/"+type+"/sort/start-desc/size/10/page/1/"; } }) 

Note the $ symbol next to href. It is recommended to use attribute bindings ($ =) to the attributes of your own elements.

+7
source

All Articles