Skip to content

Instantly share code, notes, and snippets.

View jose-marin's full-sized avatar

Jose Marin jose-marin

  • London
View GitHub Profile
const x = [1, 2, 3];
function delay() {
return new Promise(resolve => setTimeout(resolve, 1000));
}
async function delayLog(item) {
await delay();
console.log(item);
}
@jose-marin
jose-marin / onEnter.js
Last active August 11, 2016 15:02 — forked from EpokK/ngEnter.js
ngEnter directive if you can use submit form(https://twitter.com/ririlepanda)
app.directive('onEnter', function() {
return {
restrict: "A",
scope: {
action: "&onEnter"
},
link: function(scope, element, attrs) {
element.on("keydown keypress", function(event) {
if(event.which === 13) {
scope.$apply(scope.action);