title: Subscribe on property in loop - KnockoutJs
body: <p>I need help in subsribing on property in object. I don't know which property name will be and how much, I'm generating an object of properties according to data from the server. </p>
  
  <p>I have code like:</p>
  
  <pre><code>viVm.requestData.ageGroups = {};
  
      var classificators = viVm.requestData.multiTrip() === 1
          ? viVm.classificators.ageGroups.multiTrip
          : viVm.classificators.ageGroups.singleTrip;
  
      classificators().forEach(function (entry, index) {
          var entry = ko.toJS(entry);
          var code = entry.code;
  
          viVm.requestData.ageGroups[code] = 0;
  
          viVm.requestData.ageGroups[code].subscribe(function (newValue) {
              validateAgeGroupValue(newValue, viVm.requestData.ageGroups[code]);
          });
  
      });
  </code></pre>
  
  <p>It sets up property and it's value tom0, but on <code>.subscribe()</code> step I get an error - <code>viVm.requestData.ageGroups[code].subscribe is not a function</code></p>
  
  <p>Could enybody explain what I do wrong and maybe offer some variant how to make it work?
  Thank you.</p>