Skip to content

Instantly share code, notes, and snippets.

View spunkypanda's full-sized avatar
🏠
Working from home

Chinmay Bag spunkypanda

🏠
Working from home
View GitHub Profile
@EpokK
EpokK / ngEnter.js
Last active January 7, 2022 13:57
ngEnter directive if you can use submit form(https://twitter.com/ririlepanda)
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();
}