[Angularjs] markdown editor modules: Install markdown angular-marked and highlight.js

Angularjs Markdown Modules https://github.com/Hypercubed/angular-marked highlight.js: Syntax highlighting for the Web Install markdown angular-marked and highlight.js Install modules: bower install –save highlightjs bower install –save angular-marked Angularjs: [js] var app = angular.module(‘exampleApp’, [‘hc.marked’]); app.config([‘markedProvider’, function (markedProvider) { markedProvider.setOptions({ gfm: true, tables: true, highlight: function (code, lang) { if (lang) { return hljs.highlight(lang, code, true).value; } else…

Read More

[bootstrap-markdown] show and hide markdown editor programmatically

html: [html] Edit [/html] Angularjs: [js] editComment(comment){ var self = this; var editor = angular.element($(`#${comment._id}`)); editor.markdown({autofocus: true, savable: true, hideable:true, onSave: function(e) {//e: markdown editor self.Blog.saveComment({ id: self.blog._id, comment_id: comment._id, content: e.getContent() }).$promise .then(() => { //angular.element($(‘.md-editor’)).children(‘.md-footer’).html(‘Comment is updated.’); var el = angular.element($(‘.md-editor’)).parents(‘.panel’); el.css( “background-color”, “#ffeeff” ); setTimeout(() => { el.css( “background-color”, “#ffffff” ); },…

Read More