title: Refresh dropdown list with db datasource in angularJs
body: <p>I have a dropdown list that get its element from database, the thing is i want to add new element to the list and be able to see the new added element without refreshing the page. I tried to remove the old list and make new http request to get the new elements directly from db but unfortunately Iam missing something somewhere. here is the code:</p>
  
  <pre><code>$http.post('/api/adminPanel/createTagType', tagDetails).then(function (response) {
              console.log("Response from Controller: " + JSON.stringify(response));
              if(response.data==='success'){
  
                  $http.get('api/adminPanel/getTags').then(function(result){
                      try{
                          $scope.tags = result.data.tags;
                          console.log($scope.tags);
                      }catch(error){
                          console.log(error);
                      }
                  });
              }
          });
  </code></pre>
  
  <p>First i <code>post</code> the new value and check if request is succeeded then, I make new <code>get</code> request to get the new list.
  Could you guys help me out to solve this problem? </p>
  
  <p><strong>Update</strong></p>
  
  <p>This is the html code:</p>
  
  <pre><code>    &lt;select name= "inputTag" id= "inputTag" class="form-control" ng-model="Tag"&gt;
      &lt;option value=""&gt;Select Tag Type&lt;/option&gt;
      &lt;option ng-repeat="tag in tags" value="{{tag.idtagTypes}}" &gt;{{tag.tagName}}&lt;/option&gt;
  &lt;/select&gt;&lt;br/&gt;
   &lt;button class="btn btn-primary" ng-click="addTag()"&gt;Add Tag&lt;/button&gt;
  </code></pre>