{"action":"closed","issue":{"url":"https://api.github.com/repos/angular-ui/ui-tinymce/issues/157","labels_url":"https://api.github.com/repos/angular-ui/ui-tinymce/issues/157/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ui-tinymce/issues/157/comments","events_url":"https://api.github.com/repos/angular-ui/ui-tinymce/issues/157/events","html_url":"https://github.com/angular-ui/ui-tinymce/issues/157","id":98463671,"number":157,"title":"Clear undo history","user":{"login":"qjie2006","id":13593047,"avatar_url":"https://avatars.githubusercontent.com/u/13593047?v=3","gravatar_id":"","url":"https://api.github.com/users/qjie2006","html_url":"https://github.com/qjie2006","followers_url":"https://api.github.com/users/qjie2006/followers","following_url":"https://api.github.com/users/qjie2006/following{/other_user}","gists_url":"https://api.github.com/users/qjie2006/gists{/gist_id}","starred_url":"https://api.github.com/users/qjie2006/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qjie2006/subscriptions","organizations_url":"https://api.github.com/users/qjie2006/orgs","repos_url":"https://api.github.com/users/qjie2006/repos","events_url":"https://api.github.com/users/qjie2006/events{/privacy}","received_events_url":"https://api.github.com/users/qjie2006/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular-ui/ui-tinymce/labels/needs%20plunker","name":"needs plunker","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-31T20:13:58Z","updated_at":"2015-11-28T21:14:40Z","closed_at":"2015-11-28T21:14:40Z","body":"I added two lines of code to clear the undo history, is it the right place to add?\r\n\r\n ngModel.$render = function() {\r\n          if (!tinyInstance) {\r\n            tinyInstance = tinymce.get(attrs.id);\r\n          }\r\n          if (tinyInstance) {\r\n              tinyInstance.setContent(ngModel.$viewValue || '');\r\n              tinyInstance.undoManager.clear(); //clear up undo history\r\n              tinyInstance.nodeChanged();       //update UI states\r\n          }\r\n        };"}}