Skip to content

Instantly share code, notes, and snippets.

View jfairbank's full-sized avatar

Jeremy Fairbank jfairbank

View GitHub Profile
@jfairbank
jfairbank / app.js
Last active September 26, 2017 16:20
ES7 Class Decorators, Properties, and Angular
import angular from 'angular';
import MyService from './myService';
import myDirective from './myDirective';
angular.module('myApp', [])
.service('myService', MyService)
.directive('myDirective', myDirective);
@jfairbank
jfairbank / es5-callbacks.js
Last active March 14, 2022 11:51
JavaScript Function Bind Syntax
var eventLib = require('eventLib');
var self = this;
eventLib.on('foo', function() {
self.gotFoo();
});
eventLib.on('bar', this.gotBar.bind(this));
eventLib.on('log', console.log.bind(console));