5182: Silently skip Angular initialization if injector() returns null.
authorTom Clegg <tom@curoverse.com>
Tue, 10 Mar 2015 07:06:44 +0000 (03:06 -0400)
committerTom Clegg <tom@curoverse.com>
Tue, 10 Mar 2015 07:06:44 +0000 (03:06 -0400)
This happens occasionally during tests, and seems benign (except that
our tests demand an empty debug console).

apps/workbench/app/assets/javascripts/angular_shim.js

index 8665c73ddbf2f0ab743ee28da49f353deca7bd8e..976d09b28e7e47eb252e18172c0601acb42e1448 100644 (file)
@@ -3,7 +3,7 @@
 // arv:pane:loaded event after updating the DOM.
 
 $(document).on('arv:pane:loaded', function(event, $updatedElement) {
-    if (angular && $updatedElement) {
+    if (angular && $updatedElement && angular.element($updatedElement).injector()) {
         angular.element($updatedElement).injector().invoke([
             '$compile', function($compile) {
                 var scope = angular.element($updatedElement).scope();