Como aplicar o codemirror no modal de bootstrap

var myCodeMirror = CodeMirror(document.querySelector('.codemirror-init'), {
  value: 'Your Value',
  lineNumbers: true,
  tabSize: 2,
  mode: 'javascript',
  theme: 'monokai'
});

$('#exampleModal').on('shown.bs.modal', function() {
    // Refresh Code mirror Here
       myCodeMirror.refresh();
});
Concerned Cormorant