I don't think you want to be extending ui-contact in this case, but rather
using it as an internal element. I can't speak definitively because the
code provided is too barebones to reveal intention, but I would imagine it
would be something more like:
<template repeat="{{contact in contacts}}">
<ui-contact-chip contact="{{contact}}"></ui-contact-chip>
</template>
Where ui-contact-chip would be defined more like:
<polymer-element name="ui-contact-chip" attributes="contact">
<template>
<ui-contact id="contact" data="{{contact}}"></ui-contact>
<template bind="{{$.contact}}" if="{{$.contact.name}}">
<div>{{name}}</div>
</template>
</template>
</polymer-element>
This is just rough and spitballing, but the point is that extension should
be thought of like class inheritance. You're saying that ui-contact-chip IS
A ui-contact. What I think you want instead is to say that ui-contact-chip
REFERENCES A ui-contact.
On Thursday, July 10, 2014 12:28:23 PM UTC-7, Filipe Araujo wrote:
>
> I am trying to build 3 components, one being a model ( ui-contact ) and
> two that extends from that model ( ui-contact-form, ui-contact-chip ). I
> am running into the issue that when ui-contact-chip houses a
> ui-contact-form the name updates are triggering twice.
>
>
> What happens on updating input
>
> - data-bind updates *ui-contact-form* value
> - nameChanged triggered on ui-contact that* ui-contact-form* inherits
> from
> - data-bind link between form and chip updates *ui-contact-chip* value
> - nameChanged triggered on ui-contact that *ui-contact-chip* inherits
> from
>
>
> Is there a better way to do this?
>
>
>
>
> https://gist.github.com/filaraujo/ec9f0ff49718602de139
>
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/656d4917-9d2c-4c2f-9ea8-7a9016c83ac7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.