Skip to content

Commit dbdab01

Browse files
author
Damien Jones
committed
Fixes issue #17
1 parent da4613e commit dbdab01

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/angular-markdown-editor.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ angular
1111
if (! element.hasClass('processed')) {
1212
element.addClass('processed');
1313

14+
// if the directive was called after document.ready, e.g. because of ng-if then the element
15+
// will not have been initialized by bootstrap-markdown
16+
if (element.markdown === undefined){
17+
element.data('markdown', (data = new $.fn.markdown.Constructor(element[0], {})))
18+
}
19+
1420
// Setup the markdown WYSIWYG.
1521
element.markdown({
1622
autofocus: options.autofocus || false,

0 commit comments

Comments
 (0)