I'll look into that as well. I've also been using the TemplateBinding
library e.g. templates without polymer elements so straight up it would not
work.
However, maybe all I need to do is define something like a UserElement that
is merely designed to wrap around some content and optionally reference a
template to use in its interior. Then I could override the prototype
function without disrupting the rest of the world.
On Thursday, May 15, 2014 6:28:12 PM UTC-4, Scott Miles wrote:
>
> Every Polymer element has this (prototypical) method:
>
> fetchTemplate: function(elementElement) {
> return elementElement.querySelector('template');
> }
>
>
> You can override this method to return whatever template you want, just
> keep in mind that it may get called more than once if your element has
> other Polymer superclasses.
>
>
>
> On Thu, May 15, 2014 at 1:38 PM, <[email protected] <javascript:>> wrote:
>
>> I'll give that a try and see if works and how it feels. I was hoping that
>> that I could place a "function" into the ref, or add an "element" to the
>> page that sets a strategy handler somewhere and have that handler run to
>> perform the selection e.g. search the dom. That way the logic is not
>> scattered around on the templates themselves.
>>
>>
>>
>> On Thursday, May 15, 2014 2:20:36 PM UTC-4, Eric Bidelman wrote:
>>
>>> Can you just use conditional
>>> templates<http://www.polymer-project.org/docs/polymer/binding-types.html#conditional-templates>for
>>> this?
>>>
>>> <template if="{{jsonObj.type == 'foo'}}">
>>> ...
>>> </template>
>>>
>>> <template if="{{jsonObj.type == 'bar'}}">
>>> ...
>>> </template>
>>>
>>>
>>> On Thu, May 15, 2014 at 7:00 AM, <[email protected]> wrote:
>>>
>>>> Is there any way to set a template selection "ref" that can be
>>>> chained to the default algorithm which selects by ref name?
>>>>
>>>> I typically bind to json data and wanted to have a template
>>>> automatically selected based on a "type" field in my json object.
>>>>
>>>> I do not mind loading 10-15, relatively small templates up front for
>>>> the different types of visual presentations for specific data objects in
>>>> my
>>>> webapp.
>>>>
>>>> Follow Polymer on Google+: plus.google.com/107187849809354688692
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Polymer" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>>
>>>> To view this discussion on the web visit https://groups.google.com/d/
>>>> msgid/polymer-dev/906b1429-ca0e-48cc-8d6e-602c1b7d1e8b%
>>>> 40googlegroups.com<https://groups.google.com/d/msgid/polymer-dev/906b1429-ca0e-48cc-8d6e-602c1b7d1e8b%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>> Follow Polymer on Google+: plus.google.com/107187849809354688692
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Polymer" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/polymer-dev/b7caf7fb-7938-414f-b05d-7c66e894e4f2%40googlegroups.com<https://groups.google.com/d/msgid/polymer-dev/b7caf7fb-7938-414f-b05d-7c66e894e4f2%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/polymer-dev/40f8e3ba-04b9-470b-bde7-48e5e23e4b33%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.