sort array in angularjs
<p>Im working on sorting on an array using Angular JS using orderBy. But still its not getting sorted on a particular key. </p>

<p>Here is the code </p>

<pre><code>var app = angular.module('sortModule', [])
app.controller('MainController', function($scope,$filter){    
$scope.languages = [ 
        { name: 'English', image: '/images/english.png',key:2 },
        { name: 'Hindi', image: '/images/hindi.png',key:3 },
    { name: 'English', image: '/images/english.png',key:2},
    { name: 'Telugu', image: '/images/telugu.png',key:1 }];        

var newLanguages = []
newLanguages = angular.copy($scope.languages);  
function sortImages() { 
        $scope.languages = []
    $scope.keys = []        
        for(language in newLanguages) {
            $scope.keys.push(newLanguages[language])
    }
    $filter('orderBy')($scope.keys, 'key')
    console.log(JSON.stringify($scope.keys))
}
sortImages();
</code></pre>

<p>});</p>

<p><a href="http://jsfiddle.net/SyedNizamChennai/kjuemhua/16/" rel="nofollow">Fiddle</a> </p>

<p>Im planning to see sorting based on "key". telugu should come first, english next and hindi last. </p>