You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue, #13, is still a problem as far as I can tell. If the directive is fired after the document.ready runs then bootstrap-markdown will not have initialized the newly added textarea element.
This is a snippet of html that exposes the problem:
To initialize the element with bootstrap-markdown I added the following:
link: function(scope, element, attrs, ngModel) {
var options = scope.$eval(attrs.markdownEditor);
// Only initialize the $.markdown plugin once.
if (! element.hasClass('processed')) {
element.addClass('processed');
// if the directive was called after document.ready, e.g. because of ng-if then the element
// will not have been initialized by bootstrap-markdown
if (element.markdown === undefined){
element.data('markdown', (data = new $.fn.markdown.Constructor(element[0], {})))
}
// Setup the markdown WYSIWYG.
element.markdown({
I've forked the repository and will submit a pull request.
The text was updated successfully, but these errors were encountered:
DGJones
changed the title
ng-if If the markdown-editor directive
Editor does not show up if directive is inside a dynamically added element, e.g. due to ng-if
Nov 2, 2017
Hi,
This issue, #13, is still a problem as far as I can tell. If the directive is fired after the document.ready runs then bootstrap-markdown will not have initialized the newly added textarea element.
This is a snippet of html that exposes the problem:
To initialize the element with bootstrap-markdown I added the following:
I've forked the repository and will submit a pull request.
The text was updated successfully, but these errors were encountered: