Fixed bug in templateHook directive. Fixed #2362.

This commit is contained in:
Norman Jäckel 2016-09-08 00:58:02 +02:00
parent f6ece5f6b3
commit 1cdcad7d47

View File

@ -277,9 +277,14 @@ angular.module('OpenSlidesApp.core', [
template: '',
link: function (scope, iElement, iAttr) {
var hooks = templateHooks.hooks[iAttr.hookName];
var html = hooks.map(function (hook) {
return '<div>' + hook.template + '</div>';
}).join('');
var html;
if (hooks) {
html = hooks.map(function (hook) {
return '<div>' + hook.template + '</div>';
}).join('');
} else {
html = '';
}
iElement.append($compile(html)(scope));
}
};