@@ -80,8 +80,10 @@ textAngular.run([function(){
80
80
} ] ) ;
81
81
82
82
textAngular . directive ( "textAngular" , [
83
- '$compile' , '$timeout' , 'taOptions' , 'taSelection' , 'taExecCommand' , 'textAngularManager' , '$window' , '$document' , '$animate' , '$log' , '$q' ,
84
- function ( $compile , $timeout , taOptions , taSelection , taExecCommand , textAngularManager , $window , $document , $animate , $log , $q ) {
83
+ '$compile' , '$timeout' , 'taOptions' , 'taSelection' , 'taExecCommand' ,
84
+ 'textAngularManager' , '$window' , '$document' , '$animate' , '$log' , '$q' , '$parse' ,
85
+ function ( $compile , $timeout , taOptions , taSelection , taExecCommand ,
86
+ textAngularManager , $window , $document , $animate , $log , $q , $parse ) {
85
87
return {
86
88
require : '?ngModel' ,
87
89
scope : { } ,
@@ -341,7 +343,14 @@ textAngular.directive("textAngular", [
341
343
}
342
344
} ) ;
343
345
}
344
-
346
+
347
+ if ( attrs . taPaste ) {
348
+ scope . _pasteHandler = function ( _html ) {
349
+ return $parse ( attrs . taPaste ) ( scope . $parent , { $html : _html } ) ;
350
+ } ;
351
+ scope . displayElements . text . attr ( 'ta-paste' , '_pasteHandler($html)' ) ;
352
+ }
353
+
345
354
// compile the scope with the text and html elements only - if we do this with the main element it causes a compile loop
346
355
$compile ( scope . displayElements . scrollWindow ) ( scope ) ;
347
356
$compile ( scope . displayElements . html ) ( scope ) ;
@@ -401,7 +410,11 @@ textAngular.directive("textAngular", [
401
410
} ;
402
411
scope . displayElements . html . on ( 'blur' , _focusout ) ;
403
412
scope . displayElements . text . on ( 'blur' , _focusout ) ;
404
-
413
+
414
+ scope . displayElements . text . on ( 'paste' , function ( event ) {
415
+ element . triggerHandler ( 'paste' , event ) ;
416
+ } ) ;
417
+
405
418
// Setup the default toolbar tools, this way allows the user to add new tools like plugins.
406
419
// This is on the editor for future proofing if we find a better way to do this.
407
420
scope . queryFormatBlockState = function ( command ) {
0 commit comments