Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <dom-module id="x-property-path-bound">
- <template>
- <carbon-route
- route="{{route}}"
- match=":foo/:bar/:baz"
- data.foo="{{foo}}"
- data.bar="{{bar}}"
- data.baz="{{baz}}">
- </carbon-route>
- </template>
- <script>
- Polymer({
- is: 'x-property-path-bound',
- properties: {
- baz: {
- type: String,
- observer: '_bazChanged'
- }
- },
- observers: [
- '_fooBarChanged(foo, bar)'
- ],
- // It is very easy to create an observer for discrete
- // parts of the "data" object:
- _fooBarChanged: function(foo, bar) {},
- // It is possible to observe changes and receive the
- // "old" value:
- _bazChanged: function(baz, oldBaz) {}
- });
- </script>
- </dom-module>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement