title: AngularJS initially fill array with true, one for each in model
body: <p>I want to have an array with values, one 'true' for each object in my model.</p>
  
  <p>As you can see in my <a href="http://jsfiddle.net/Pixic/Q5WyX/" rel="nofollow">JSFiddle - Hardcoded working</a>, I have currently hard coded the values, and then it works, i.e. the "level 2" tables being collapsed from start.</p>
  
  <pre><code>$scope.dayDataCollapse = [true, true, true, true, true, true];
  
  $scope.dayDataCollapseFn = function () {
      for (var i = 0; $scope.storeDataModel.storedata.length - 1; i += 1) {
          $scope.dayDataCollapse.append('true');
      }
  };
  </code></pre>
  
  <p>But when I replace the hardcoded with an empty array and a function (shown above) to populate it for me, meaning appending 'true' for each store in the storeDataModel, it fails. All level 2 tables are expanded from start, but can collapse them by clicking two times (one for adding value to array and one for collapsing).</p>
  
  <p>Have also tried with a "real" function...: </p>
  
  <pre><code>function dayDataCollapseFn() {
      for (var i = 0; $scope.storeDataModel.storedata.length - 1; i += 1) {
          $scope.dayDataCollapse.append('true');
      }
  };
  </code></pre>
  
  <p>...but I can't get the $scope.dayDataCollapse to populate initally.</p>
  
  <p>How can I solve this?</p>