6

I managed to two-way-bind my Angular.dart model to paper elements using the bind- syntax:

<paper-input bind-value="item.name"></paper-input>

Now I want to create a custom component that can expose a property for two-way binding:

@CustomTag('px-test')
class PxTest extends PolymerElement {

  @published
  var data = 1;
}

used like:

<px-test bind-data="item.data"></px-test>

The component gets rendered, and the data-field, referenced in the component template with {{data}} is rendered correctly, but the binding of data to item.data is not happening, i.e. if item.data is 55 the component still renders 1. Angular also tries to create the binding, a watch on item.data is created, but the changes are not propagated to PxTest.data What do I have to change in PxTest to make the binding happening?

Versions: Angular: 1.0, Polymer: 0.15.1+3

1 Answer 1

1

I don't know details about how binding between Angular.dart and Polymer.dart works but I suggest you try

//@published
@PublishedProperty(reflect: true)
var data = 1;

this way the DOM attribute gets updated too.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.