Created
February 20, 2013 21:55
-
-
Save paprikka/5000011 to your computer and use it in GitHub Desktop.
CKEDITOR directive for angularJS + CoffeeScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('app.directives.ckeditor', []) | |
.directive 'ckeditor', -> | |
require: '?ngModel' | |
link: (scope, elm, attr, ngModel)-> | |
ck = CKEDITOR.replace elm[0] | |
unless ngModel then return | |
ck.on 'pasteState', -> | |
scope.$apply -> | |
ngModel.$setViewValue ck.getData() | |
ngModel.$render = (value)-> ck.setData ngModel.$viewValue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment