mirror of https://github.com/grafana/grafana
parent
69d0e82453
commit
f67563e9ee
@ -0,0 +1,3 @@ |
||||
import './edit_ctrl'; |
||||
import './list_ctrl'; |
||||
import './app_srv'; |
@ -1,32 +0,0 @@ |
||||
define([ |
||||
'angular', |
||||
], |
||||
function (angular) { |
||||
'use strict'; |
||||
|
||||
var module = angular.module('grafana.directives'); |
||||
|
||||
module.directive('appConfigLoader', function($compile) { |
||||
return { |
||||
restrict: 'E', |
||||
link: function(scope, elem) { |
||||
var directive = 'grafana-app-default'; |
||||
//wait for the parent scope to be applied.
|
||||
scope.panelAdded = false; |
||||
scope.$watch("current", function(newVal) { |
||||
if (newVal && !scope.panelAdded) { |
||||
if (newVal.module) { |
||||
scope.panelAdded = true; |
||||
directive = 'grafana-app-'+newVal.type; |
||||
scope.require([newVal.module], function () { |
||||
var panelEl = angular.element(document.createElement(directive)); |
||||
elem.append(panelEl); |
||||
$compile(panelEl)(scope); |
||||
}); |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
}; |
||||
}); |
||||
}); |
Loading…
Reference in new issue