Polymer: dom-repeat items - Is it possible to shuffle repeating items.? -
in polymer template: dom-repeat items - possible shuffle repeating items.?
please possible solution..
yes, use sort function randomly assign item position rather sorting it.
<template is="dom-repeat" items="[[items]]" sort="_sortitems" initial-count="1"> <a href$="#[[section]]/[[item.id]]" class="item" aria-label$="more information [[item.title]]"> <shrine-item item="[[item]]"></shrine-item> </a> </template> _sortitems: function() { return math.round(math.random()*3) - 1; }
Comments
Post a Comment