Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #html file
- <dom-module id="year-view">
- <style>
- paper-card {
- margin-bottom: 20px;
- }
- </style>
- <template>
- <iron-ajax
- auto
- url="{{url}}"
- handle-as="json"
- last-response="{{response}}">
- </iron-ajax>
- <template is="dom-repeat" items="[[response]]">
- <div class="col-xs-6 col-sm-3">
- <paper-card image="[[item.chapters.0.data.thumbnails]]" >
- <month-name the-month="[[item.latest_date]]"></month-name>
- <div class="catebox">
- <template is="dom-repeat" items="[[item.categories]]">
- <category-color the-cateid="[[item]]" ></category-color>
- </template>
- </div>
- </paper-card>
- </div>
- </template>
- </template>
- <script src="year-view.js"></script>
- </dom-module>
- #js file
- (function() {
- 'use strict';
- Polymer({
- is: 'year-view',
- listeners: {
- 'tap': 'regularTap'
- },
- properties:{
- theYear:{
- reflectToAttribute: true,
- type:String
- },
- url:{
- computed: 'computeUrl(theYear)'
- }
- },
- computeUrl: function(theYear){
- return ['/api/calendar',theYear].join('/');
- },
- regularTap:function(e){
- alert("Hmmmm "+this.theCateid);
- }
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment