mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Cleaner using bind
This commit is contained in:
4
js/ext/angular/src/directive/ionicList.js
vendored
4
js/ext/angular/src/directive/ionicList.js
vendored
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user