浏览代码

AppPlugin: avoid app plugin navigation slowness (#16675)

navigation between pages in app plugin is slow, due to use of non angular native promise

Fixes #16672
teajo 6 年之前
父节点
当前提交
80cca9c12e
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      public/app/features/plugins/plugin_page_ctrl.ts

+ 3 - 2
public/app/features/plugins/plugin_page_ctrl.ts

@@ -11,10 +11,11 @@ export class AppPageCtrl {
   navModel: any;
 
   /** @ngInject */
-  constructor(private $routeParams: any, private $rootScope, private navModelSrv) {
+  constructor(private $routeParams: any, private $rootScope, private navModelSrv, private $q) {
     this.pluginId = $routeParams.pluginId;
 
-    getPluginSettings(this.pluginId)
+    this.$q
+      .when(getPluginSettings(this.pluginId))
       .then(settings => {
         this.initPage(settings);
       })