title: knockoutjs : multiple countdown timers in list (foreach)
body: <p>I found an existing countdown timer example here on stackoverflow : 
  <a href="https://stackoverflow.com/questions/18453362/need-a-knockout-timer-for-the-project">solution by @Jeroen</a></p>
  
  <p>This is using a single timer on a single ko.observable(num).</p>
  
  <p>I need to implement this in a foreach context (list)...
  the list is a ko.observableArray(), and i'm not sure how i can do the following : </p>
  
  <p>1) Make the property myObservableList.DeliveryTime observable on the fly</p>
  
  <p>2) Create a function which takes the value (hh:mm) as parameter, and returns/init's the countdown timer</p>
  
  <p><strong>See the included snippet :</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function ViewModel() {
      var self = this;
          
      self.timer = ko.observable(60);
       
      setInterval(function() {
          var newTimer = self.timer() - 1;
          self.timer(newTimer &lt;= 0 ? 60 : newTimer);
      }, 1000);
  };
  
  ko.applyBindings(new ViewModel());</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.2.0/knockout-min.js"&gt;&lt;/script&gt;
  
  &lt;div id="timer"&gt; &lt;span data-bind="text: timer"&gt;&lt;/span&gt; &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>