3021: Skip angular init if angular is not loaded.
authorTom Clegg <tom@curoverse.com>
Sat, 3 Jan 2015 06:52:34 +0000 (01:52 -0500)
committerTom Clegg <tom@curoverse.com>
Sat, 3 Jan 2015 06:52:34 +0000 (01:52 -0500)
apps/workbench/app/assets/javascripts/angular_shim.js

index a5366e3ccba517abf23aee732f074878b1cc5743..72729cdc0abd9bed822d362b0fd5944688520a00 100644 (file)
@@ -1,9 +1,9 @@
 // Compile any new HTML content that was loaded via jQuery.ajax().
-// Currently this only works for tabs because they emit an
+// Currently this only works for tabs, and only because they emit an
 // arv:pane:loaded event after updating the DOM.
 
 $(document).on('arv:pane:loaded', function(event, $updatedElement) {
-    if ($updatedElement) {
+    if (angular && $updatedElement) {
         angular.element($updatedElement).injector().invoke(function($compile) {
             var scope = angular.element($updatedElement).scope();
             $compile($updatedElement)(scope);