title: Trouble initializing a $scope variable with ng-init in my HTML
body: <p>I am trying to initialize <code>$scope.selectedModel</code> to <code>model1</code>with <code>ng-init</code>. However, the following HTML fails to accomplish this:</p>
  
  <pre><code>&lt;div class="productImage"&gt;
      &lt;div class="imageGallery" ng-init="selectedModel='model1'"&gt;
  
          &lt;div ng-repeat="mod in pTab" ng-if="modelIsActive(mod)"&gt;
              &lt;div ng-repeat="img in mod.galleryImages"&gt;
                  &lt;img class="overviewProductImage" ng-src="{{img.image}}" ng-if="productImageIsActive(img, $index)"/&gt;
              &lt;/div&gt;
          &lt;/div&gt;  
  
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And here's the modelIsActive method that uses selectedModel:</p>
  
  <pre><code>$scope.modelIsActive = function (tab) {
              return tab.model== $scope.selectedModel;
  }
  </code></pre>
  
  <p>Eventually I will want to use <code>ng-init="selectedModel= mod.model"</code> but when that didn't work I substituted the simple string <code>'model1'</code> and found it still wasn't initializing <code>selectedModel</code>to that string.</p>
  
  <p>How can I use ng-init to set <code>$scope.selectedModel</code>? Or should I be using something else? Do I need to use <code>$watch</code> or something similar?</p>