title: Adding default option to ng-if
body: <p>In my dropdown menu, there are two options- small and large. When small is selected, a picture shows up; when large is selected, another picture shows up. I want to add a default picture for when nothing is selected (example. page just loaded). But my code below isn't working.</p>
  
  <p>AngularJS, inside controller:</p>
  
  <pre><code>var urls = {
      '': '/images/Default.png', // empty string doesn't work
      Small: '/images/Small.png',
      Large: '/images/Large.png'
  };
  
  
  $scope.getUrl = function (name) {   
      if (urls[name] !== undefined) return urls[name];
  };
  </code></pre>
  
  <p>HTML (size is the ng-model that binds what the user selects from the dropdown):</p>
  
  <pre><code>&lt;div&gt;
      &lt;img ng-src="{{getUrl(size)}}" ng-if="size"&gt;
  &lt;/div&gt;
  </code></pre>