From ec9c04befa4193ef7cf52d9924912c15542940cd Mon Sep 17 00:00:00 2001 From: Mathieu Date: Fri, 3 Jan 2014 14:52:50 +0800 Subject: [PATCH] Cleaner using bind --- js/ext/angular/src/directive/ionicList.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/js/ext/angular/src/directive/ionicList.js b/js/ext/angular/src/directive/ionicList.js index d34f647642..81dfc0f8fc 100644 --- a/js/ext/angular/src/directive/ionicList.js +++ b/js/ext/angular/src/directive/ionicList.js @@ -48,9 +48,7 @@ angular.module('ionic.ui.list', ['ngAnimate']) // Set this item's class, first from the item directive attr, and then the list attr if item not set $scope.itemClass = $scope.itemType || $parentScope.itemType; var getter = $parse( $scope.itemClass ); - $scope.parsedClass = function(a) { - return getter($scope.$parent); - }; + $scope.parsedClass = angular.bind( $scope, getter, $scope.$parent ); // Decide if this item can do stuff, and follow a certain priority // depending on where the value comes from if(($attr.canDelete ? $scope.canDelete : $parentScope.canDelete) !== "false") {