Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. <dom-module id="x-property-path-bound">
  2. <template>
  3. <carbon-route
  4. route="{{route}}"
  5. match=":foo/:bar/:baz"
  6. data.foo="{{foo}}"
  7. data.bar="{{bar}}"
  8. data.baz="{{baz}}">
  9. </carbon-route>
  10. </template>
  11. <script>
  12. Polymer({
  13. is: 'x-property-path-bound',
  14.  
  15. properties: {
  16. baz: {
  17. type: String,
  18. observer: '_bazChanged'
  19. }
  20. },
  21.  
  22. observers: [
  23. '_fooBarChanged(foo, bar)'
  24. ],
  25.  
  26. // It is very easy to create an observer for discrete
  27. // parts of the "data" object:
  28. _fooBarChanged: function(foo, bar) {},
  29.  
  30. // It is possible to observe changes and receive the
  31. // "old" value:
  32. _bazChanged: function(baz, oldBaz) {}
  33. });
  34. </script>
  35. </dom-module>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement