From bf2e209126ed389cf6fbecf1295488289f28180c Mon Sep 17 00:00:00 2001 From: Pat Long Date: Wed, 30 Dec 2015 12:57:58 -0800 Subject: [PATCH] $eval(uiScrollpointAction) instead of scope[uiScrollpointAction]. fixes bug that actions nested in objects would not be found. --- src/scrollpoint.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/scrollpoint.js b/src/scrollpoint.js index f159f94..97d8a17 100644 --- a/src/scrollpoint.js +++ b/src/scrollpoint.js @@ -277,8 +277,9 @@ angular.module('ui.scrollpoint', []).directive('uiScrollpoint', ['$window', '$ti // ui-scrollpoint-action function name to use as scrollpoint callback attrs.$observe('uiScrollpointAction', function(uiScrollpointAction){ - if(scope[uiScrollpointAction] && angular.isFunction(scope[uiScrollpointAction])){ - uiScrollpoint.addAction(scope[uiScrollpointAction]); + var action = scope.$eval(uiScrollpointAction); + if(action && angular.isFunction(action)){ + uiScrollpoint.addAction(action); } });