Advertisement
Guest User

Untitled

a guest
Dec 14th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script src="http://tinymce.cachefly.net/4.0/tinymce.min.js"></script>
  2.  
  3. //otwieranie
  4. var editor = tinymce.createEditor("noteEditor", {});
  5. var editorElement = $compile("<div id='noteEditor'></div>")(scope);
  6. angular.element(document.querySelector("#cokolwiek")).append(editorElement);
  7. editor.render();
  8. editor.setContent("ZAWARTOSC EDYTORA");
  9. cancel = $compile("<div></div>")(scope);
  10. save = $compile("<div></div>")(scope);
  11. editorElement.append(cancel);
  12. editorElement.append(save);
  13.  
  14. cancel.on("click", function() {
  15.     tinymce.remove("#noteEditor");
  16.     editorElement.remove();
  17. });
  18.  
  19. save.on("click", function() {
  20.     angular.element(document.querySelector("#cokolwiek")).html(tinymce.get("noteEditor").getContent());
  21.     tinymce.remove("#noteEditor");
  22.     editorElement.remove();
  23. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement