orderBy not working as expected: Angularjs

Have a look at below html <!DOCTYPE html> <html ng-app=”app”> <head> <title></title> <script src=”https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js”></script> </head> <body> <div ng-controller=”item”> <ul> <li ng-repeat=”item in items|orderBy:’name'”> {{item.name}} </li> </ul> </div> <script> var AppModule = angular.module(‘app’, []); function item($scope) { $scope.items = [{ name: ‘tur’ }, { name: ‘abc’ }, { name: ‘xyx’ }]; } </script> </body> </html>

Orderby not working with dict syntax on ng-repeat

The parameters to orderBy must match property names in an array of objects. Your data needs to look something like this: $scope.list2 = [ { id:”2013-01-08T00:00:00″, name:’Joe’}, { id:”2013-01-09T00:00:00″, name:’Sue’}]; Then a filter like this will work: <div ng-repeat=”item in list2 | orderBy:’id’:true”> Fiddle. Note that orderBy works on the entire array (something in your … Read more

Angularjs wrong $index after orderBy

Instead or relaying on the $index – which – as you have noticed – will point to the index in a sorted / filtered array, you can pass the item itself to your removeItem function: <a><img src=”https://stackoverflow.com/questions/16118762/img/delete.png” ng-click=”removeItem(item)”>{{$index}}</a> and modify the removeItem function to find an index using the indexOf method of an array as … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)