title: how to set function or get value from parameters on select change in angular.js
body: <p>I am newer in anguler and want a value on change from select option and want to update status of particular ID. I have setup some code but this is not working. can you help me.
  fetch data and get it on data and after that setup a select box</p>
  
  <pre><code>&lt;select ng-model="newStatus" ng-change="changeNewStatus(data.id, data.message_status)"&gt;
                        &lt;option value="1" ng-selected="data.message_status == 1"&gt;New&lt;/option&gt;
                        &lt;option value="2" ng-selected="data.message_status == 2"&gt;Closed&lt;/option&gt;
                      &lt;/select&gt;
  </code></pre>
  
  <p>now i want to print it here {{selectedResult}}
  below is my controller where i want to call this function </p>
  
  <pre><code>app.controller('MessageFetchGrid', function ($scope, $http, $timeout) {
  $scope.changeNewStatus = function(msgId, msgStatus){
              $scope.selectedResult = "msg-id="+msgId+" status= "+msgStatus;
      }
  
  });  
  </code></pre>
  
  <p>here is my full code</p>
  
  <pre><code>app.filter('startFrom', function() {
  return function(input, start) {
      if(input) {
          start = +start; //parse to int
          return input.slice(start);
      }
      return [];
  }
  </code></pre>
  
  <p>});</p>
  
  <pre><code>app.controller('MessageFetchGrid', function ($scope, $http, $timeout) {
  $http.get('api/v1/loadMessage.php').success(function(data){
      $scope.list = data;
      $scope.currentPage = 1; //current page
      $scope.entryLimit = 25; //max no of items to display in a page
      $scope.filteredItems = $scope.list.length; //Initially for no filter  
      $scope.totalItems = $scope.list.length;
  });
  $scope.setPage = function(pageNo) {
      $scope.currentPage = pageNo;
  };
  $scope.filter = function() {
      $timeout(function() { 
          $scope.filteredItems = $scope.filtered.length;
      }, 10);
  };
  $scope.sort_by = function(predicate) {
      $scope.predicate = predicate;
      $scope.reverse = !$scope.reverse;
  };  
  $scope.changeNewStatus = function(msgId, msgStatus){
          $scope.selectedResult = "msg-id="+msgId+" status= "+msgStatus;
  }   
  </code></pre>
  
  <p>});  </p>