title: Creating array with ng-model when checkbox selection
body: <p>I am new to angularjs and want to create the model array when i click the checkbox and below is my code..</p>
  
  <pre><code>$scope.selectedAlbumSongs = [{
      'name': 'song1',
          'url': 'http://test/song1.mp3'
  }, {
      'name': 'song2',
          'url': 'http://test/song2.mp3'
  }, {
      'name': 'song3',
          'url': 'http://test/song3.mp3'
  }];
  $scope.playList = {};
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;fieldset data-role="controlgroup"&gt;
      &lt;legend&gt;Select songs to play&lt;/legend&gt;
      &lt;label ng-repeat="song in selectedAlbumSongs"&gt;
          &lt;input type="checkbox" name="{{song.url}}" id="{{song.name}}" ng-model="playList[song.url]"&gt;
          &lt;label for="{{song.name}}"&gt;{{song.name}}&lt;/label&gt;
      &lt;/label&gt;
  &lt;/fieldset&gt;
  </code></pre>
  
  <p>The above code updating the playList as shown below when i click the checkbox</p>
  
  <pre><code>{
      "http://test/test1.mp3": true,
      "http://test/test2.mp32": true,
      "http://test/test3.mp3": false
  }
  </code></pre>
  
  <p>But I want to create the ng-model in the below format, and remove the object when the checkbox is unchecked (for ex. if the uncheck the song3, the song3 object removed from the array). Can you tell me how can write this logic?</p>
  
  <p>Expected: </p>
  
  <pre><code>[{
      name: "song1",
      url: "http://test/song1.mp3"
  }, {
      name: "song2",
      url: "http://test/song2.mp3"
  }]
  </code></pre>