Could something like this directive help? (found on SO)

http://stackoverflow.com/questions/17470790/how-to-use-a-keypress-event-in-angularjs


app.directive('ngEnter', function () {
    return function (scope, element, attrs) {
        element.bind("keydown keypress", function (event) {
            if(event.which === 13) {
                scope.$apply(function (){
                    scope.$eval(attrs.ngEnter);
                });

                event.preventDefault();
            }
        });
    };});









On Saturday, May 17, 2014 6:48:45 PM UTC-7, Brandon Henry wrote:
>
> In my ng-grid I have one field that requires an editable textarea. 
>  Everything works great except for when I want a new line in my textarea 
> (because hitting enter makes me leave the cell).  My editable cell template 
> is as follows:
>
>             editableCellTemplate: '<textarea style="width:100%" 
> ng-class="\'colt\' + col.index" ng-input="COL_FIELD" 
> ng-model="COL_FIELD"></textarea>',
>
> How can i make SHIFT + ENTER return a new line within the textarea?
>
>
> <https://lh5.googleusercontent.com/-1GS0cjRGf44/U3gRFDXEHHI/AAAAAAAADn4/-D-ZbyyibAQ/s1600/Truffa+Shuf-3.png>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to