title: Angular js - sorting in table based on letter ASCII value
body: <p>I've done a basic table sorting application using angular, sorting is doing but the problem is that i'm not getting the values sorted in ASCII value</p>
  
  <p>can anyone please tell me how to do it</p>
  
  <p><a href="http://jsfiddle.net/uRPSL/19/" rel="nofollow"><strong>[DEMO]</strong></a></p>
  
  <p><strong>html</strong></p>
  
  <pre><code>    &lt;div ng-app ng-controller="ArrayController"&gt;
          &lt;table&gt;
              &lt;th ng-repeat="header in headers"&gt;
                  &lt;a ng-click="sort_by(header)"&gt;{{ headers[$index] }}&lt;/a&gt;
              &lt;/th&gt;
              &lt;tr ng-repeat="arr in records |orderBy:sortingOrder:reverse"&gt;
                  &lt;td ng-repeat="val in arr" ng-bind-html-unsafe="arr[headers[$index]]"&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p><strong>script</strong></p>
  
  <pre><code>    function ArrayController($scope) {
      $scope.headers = ['col1', 'col2'];
      $scope.records = [{col1: 'a1', col2: 'd1'}, {col1: 'c2', col2: 'A2'}, {col1: 'b3', col2: 'c3'}, {col1: 'd4', col2: 'a1'}];
  
      $scope.reverse = true;
       $scope.sort_by = function(newSortingOrder)
          {
              if ($scope.sortingOrder === newSortingOrder)
              {
                $scope.reverse = !$scope.reverse;
              }
              $scope.sortingOrder = newSortingOrder;
  
            };
  }
  </code></pre>