Skip to content
This repository was archived by the owner on May 25, 2019. It is now read-only.

ng-transclude inside invalid #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/ui-codemirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,27 @@ angular.module('ui.codemirror', [])
// - the initial content of the editor.
// see http://codemirror.net/doc/manual.html#api_constructor
var value = tElement.text();
var codeMirror = new window.CodeMirror(function (cm_el) {

angular.forEach(tElement.prop('attributes'), function (a) {
return function postLink(scope, iElement, iAttrs, ngModel) {

var codeMirror = new window.CodeMirror(function (cm_el) {

angular.forEach(iElement.prop('attributes'), function (a) {
if (a.name === 'ui-codemirror') {
cm_el.setAttribute('ui-codemirror-opts', a.textContent);
} else {
} else if (a.name !== 'class') {
cm_el.setAttribute(a.name, a.textContent);
}
});

// FIX replaceWith throw not parent Error !
if (tElement.parent().length <= 0) {
tElement.wrap('<div>');
if (iElement.parent().length <= 0) {
iElement.wrap('<div>');
}

tElement.replaceWith(cm_el);
iElement.replaceWith(cm_el);
}, {value: value});

return function postLink(scope, iElement, iAttrs, ngModel) {

var options, opts;

options = uiCodemirrorConfig.codemirror || {};
Expand Down