From e5ddca34ffccfdc16cf663f70003c5729e059d0a Mon Sep 17 00:00:00 2001 From: Andy Joslin Date: Mon, 14 Apr 2014 13:55:27 -0600 Subject: [PATCH] docs(delegates): improve warning when a controller can't be found --- js/angular/service/delegateService.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/js/angular/service/delegateService.js b/js/angular/service/delegateService.js index 8c81dd351f..722269ae6d 100644 --- a/js/angular/service/delegateService.js +++ b/js/angular/service/delegateService.js @@ -65,9 +65,14 @@ function delegateService(methodNames) { if (!matchingInstancesFound) { return $log.warn( - 'Delegate for handle "'+this.handle+'" could not find a', - 'corresponding element with delegate-handle="'+this.handle+'"!', - methodName, 'was not called!'); + 'Delegate for handle "'+this.handle+'" could not find a ' + + 'corresponding element with delegate-handle="'+this.handle+'"!' + + methodName + '() was not called!\n' + + 'Possible cause: If you are calling ' + methodName + '() immediately, and ' + + 'your element with delegate-handle="messagesScroll" is a child of your ' + + 'controller, then your element may not be compiled yet. Put a $timeout ' + + 'around your call to ' + methodName + '() and try again.' + ); } return finalResult;