I am using Polymer iron-pages
along with paper-tabs
in my rails app. The problem is none of pages were shown until one of the paper-tabs
was clicked. I want the first page in iron-pages
to be selected by default without user interaction.
I have put both paper-tabs
and iron-pages
in a <template is='dom-bind'></template>
. Have read documentation about data binding, But I couldn't figure out how to achieve this. Please somebody suggest your valuable suggestions. Thank you.
<template is="dom-bind">
<div class="middle">
<paper-tabs class="bottom self-end" selected="{{selected}}">
<paper-tab>Page 1</paper-tab>
<paper-tab>Page 2</paper-tab>
</paper-tabs>
</div>
<div class="bottom">
<iron-pages selected="{{selected}}">
<div> Page 1(This should be selected by default.)
</div>
<div> Page 2
</div>
</iron-pages>
</div>
</template>