瀏覽代碼

fix(): let binding cycle complete before adding panel to dom

Torkel Ödegaard 9 年之前
父節點
當前提交
00827ce921
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      public/app/core/directives/plugin_component.ts

+ 5 - 2
public/app/core/directives/plugin_component.ts

@@ -206,9 +206,12 @@ function pluginDirectiveLoader($compile, datasourceSrv, $rootScope, $q, $http, $
     });
 
     $compile(child)(scope);
-
     elem.empty();
-    elem.append(child);
+
+    // let a binding digest cycle complete before adding to dom
+    setTimeout(function() {
+      elem.append(child);
+    });
   }
 
   function registerPluginComponent(scope, elem, attrs, componentInfo) {