title: How to keep the record whether a checkbox has been checked or not?
body: <p>I am working on a sports list in a mobile app with Ionic, there is a view where the user choose(check) which sports would like to see on the list</p>
  
  <pre><code>&lt;input type="checkbox"
         ng-model="sport.checked"
         ng-init="sport.checked=true"&gt;
  </code></pre>
  
  <p>and then once he chooses the sports, he goes to the other view</p>
  
  <pre><code>&lt;div ng-repeat="sport in sports"&gt;
      &lt;div ng-show="sport.checked"&gt;
  
        {{sport.name}}
  
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>but if the user refresh the page or go to any other view and tries to get back to the sports view, he loses the selections of sports he just did, so he needs to perform the action of selecting again which sports he wants to see.</p>
  
  <p><a href="https://www.youtube.com/watch?v=KFzhTHiNCps&amp;feature=youtu.be" rel="nofollow">I recorded this video for you to understand easier</a></p>
  
  <p>on the video you will see that I go to the view and unchecked the first two sports on the list, they disappear but once I refresh the page, those 2 sports will be on the list again.</p>
  
  <p>Maybe the issue is the <code>ng-init</code> so I want you to tell me guys what I need to do to keep the record of which sports he selects ? </p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>base on your answer, look at my controller:</p>
  
  <pre><code>angular.module('myApp')
    .controller('SportsController', function($scope, $state, $ionicModal, $ionicLoading,
                                             $timeout, AuthFactory, SportsFactory) {
      $scope.sports = [];
      $scope.customer = {};
  
      AuthFactory.getCustomer().then(function(customer) {
        $scope.customer = customer;
        SportsFactory.getSportsWithLeagues(customer).then(function(sports) {
          $ionicLoading.hide();
          if (sports.length) {
            $scope.sports = sports;
          }else {
            AuthFactory.logout();
          }
  
        }, function(err) {
          $ionicLoading.hide();
          console.log(err);
        });
      }, function(err) {
        $ionicLoading.hide();
        $state.go('app.login');
        console.log(err);
      });
  
      $scope.isSportShown = function(sport) {
        return $scope.shownSport === sport;
      };
  
      $scope.goToLines = function(league) {
        var linesParameters = {
          customerId: $scope.customer.customer,
          top: 10,
          familyGameId: -1,
          games: -1,
          sports: league.sport.id,
          leagues: league.id,
          periods: league.lineType,
          part: league.part
        };
        $state.transitionTo('app.lines', linesParameters);
      };
    });
  </code></pre>