title: Creating a controller/service to persist data, with information from the DOM
body: <p>In angular I have in a view a list of items which will be display in another view depending on whether they are checked or not.</p>
  
  <p>this is the view where you check which sports you want to display in the another view </p>
  
  <pre><code>&lt;ion-item ng-repeat="sport in sports"
            ng-init="sport.checked = true"
            ng-click="sport.checked = !sport.checked"&gt;
      {{:: sport.name}}
  &lt;/ion-item&gt;
  </code></pre>
  
  <p>this is the another view</p>
  
  <pre><code>&lt;div ng-show="sport.checked"
    ng-repeat="sport in sports"&gt;
      {{sport.name}}
  &lt;/div&gt;
  </code></pre>
  
  <p>as you see all those sports has an <code>ng-init = sport.checked = true</code>, so all the sports are shown at the beginning but you can unchecked those sports in order to don't see them until you checked it again.</p>
  
  <p>that's all I have so far and works, but once you refresh the page, all the checks and unchecks die, everything restarts after refreshing, so as you know I need to persist that data in a DB or something, I am using node.js/sails.js along with Redis for this. I have an idea of how to create almost everything in the node.js part, but I need some help in the Angular part with the controller and the service, so I need your help here.</p>
  
  <p>I want that the users are able to checked their sports only once, and not every time they log in on the app.</p>
  
  <p>So what functions can I add to the controller to advise to the service when a sport has been unchecked, and how the service will be receiving that data ? </p>
  
  <p>also, if you have any suggestions for the NodeJS part, that would be awesome too.</p>