Cleaner using bind

This commit is contained in:
Mathieu
2014-01-03 14:52:50 +08:00
parent afa389d9ce
commit ec9c04befa

View File

@@ -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") {