Fix strange bug where select boxes in edit marker/line are not initialised properly (#39)

pull/54/merge
Candid Dauth 2016-12-27 22:21:08 +01:00
rodzic f520be612d
commit 348f1ca4f4
1 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -38,8 +38,12 @@
el.attr("id", attrs.fmTypeFieldId);
el.appendTo(element.empty());
$compile(el)(scope);
scope.$evalAsync(); // $compile only replaces variables on next digest
// For some reason, if we call $compile directly, select boxes will not select the right value
// with newer versions of angular
scope.$evalAsync(function() {
$compile(el)(scope);
});
};
scope.$watch(attrs.fmTypeField+".type", update);