title: ng-repeat with ng-selected
body: <p>I am trying to figure out how to generate list of option elements using ng-repeat, but one of them to be marked as the selected option on load.</p>
  
  <p>After googling, what I found is this base, which I modified by adding the selected property to the data objects
  <a href="https://plnkr.co/edit/7g4MeAQnG4PzpnrebBGc?p=preview" rel="nofollow noreferrer">https://plnkr.co/edit/7g4MeAQnG4PzpnrebBGc?p=preview</a>
  However, it seems that <code>ng-selected="option.selected == true"</code> has no effect :(</p>
  
  <p>Why? I also have the more complex example here: <a href="http://jsfiddle.net/ej5fx3kr/14/" rel="nofollow noreferrer">http://jsfiddle.net/ej5fx3kr/14/</a> which works, although I am not sure what is the difference, or what is the model here used for (note: changing the model name from "program" to anything, it still works... so not sure what is the purpose).</p>
  
  <p><strong>Bonus points:</strong> How do I debug code in AngularJS in directives? Like experiment in debug mode line by line to actually see what are the variable values in that particular scope, what is available to use, etc...</p>
  
  <p>My ultimate goal in this question, is to load list of values via ajax on page load in the controller, IF there is a routeParam in the URL, find it in the list of loaded values, and add selected attribute, then set selected=true in the generated HTML on page load, otherwise not pre-select anything in the populated select box on the page load, so this is why its important for me to understand this on the simplest example before trying to plug this in.</p>
  
  <p>Thanks!</p>