title: how to create a drop down redirect page using angular JS
body: <p>I would like to create a drop down redirect page in angular JS. Where in when a user selects the drop down and then clicks Go button he is directed to the page.</p>
  
  <p>below is the angularJS script, with a little Javescript and the Html page.</p>
  
  <pre><code>//Angular JS
  function TheController($scope) {
  
      $scope.locations = [
          {LocationId : "http://www.google.com/", LocationName : 'Philippines' },       
          {LocationId : " http://www.yahoo.com/" , LocationName : 'Canada' },
          {LocationId : " http://www.bing.com/", LocationName : 'China' } ];
  
      function goToNewPage(dropdownlist)
   {
   var url = dropdownlist.options(dropdownlist.selectedIndex).value;
   if (url != "")
   {
   window.open(url);
   }
   }
  
   }
  
  //Html
  &lt;form name="dropdown"&gt;
  
  &lt;div ng-controller="TheController" ng-app&gt;
  
  
  Another Location:    
  &lt;select ng-model="anotherLocationId" onchange="goToPage(this.options(this.selectedIndex).value)" &gt;
      &lt;option ng-repeat="location in locations" value="{{location.LocationId}}"&gt;{{location.LocationName}}&lt;/option&gt;
  &lt;/select&gt;    
  
      &lt;hr/&gt;
  
  
      Another Location: {{anotherLocationId}}
  
  
  &lt;/div&gt;
  
  &lt;input type=button value="Go" onclick="goToNewPage(document.dropdown.list)"&gt;
      &lt;/form&gt;
  </code></pre>