You should look at my polymer component <page-title> here: https://github.com/zacharytamas/page-title/ . You can also install it using Bower:
bower install page-title
You probably need some kind of function that maps the selected index from <iron-pages> to the text you want to show as the title. In your example, you can simply innerText selected element, but in practice your <iron-pages> elements will have content in them.
This will depend on your setup, but you can use my component to easily link them, for example:
<dom-module id="my-app"> <template> <page-title base-title="My Website" title="[[selectedPage.title]]"></page-title> <iron-pages selected-item="{{selectedPage}}"> <div title="First Page">One</div> <div title="Second Page">Two</div> <div title="Third Page">Three</div> </iron-pages> </template> <script> Polymer({ is: 'my-app' }); </script> </dom-module>
Here, I just did some attachment to associate the page title with the title attribute of the currently selected element from <iron-pages> . It works very well! You may have to accept your situation, but this should make you.
source share