GUACAMOLE-136: Make $element available to field type controllers.

This commit is contained in:
Michael Jumper
2016-12-05 22:08:15 -08:00
parent b4ea239b5f
commit 567df5a467

View File

@@ -249,7 +249,10 @@ angular.module('form').provider('formService', function formServiceProvider() {
// Populate scope using defined controller // Populate scope using defined controller
if (fieldType.module && fieldType.controller) { if (fieldType.module && fieldType.controller) {
var $controller = angular.injector(['ng', fieldType.module]).get('$controller'); var $controller = angular.injector(['ng', fieldType.module]).get('$controller');
$controller(fieldType.controller, {'$scope' : scope}); $controller(fieldType.controller, {
'$scope' : scope,
'$element' : angular.element(fieldContainer.childNodes)
});
} }
// Compile DOM with populated scope // Compile DOM with populated scope