Skip to content

Instantly share code, notes, and snippets.

@aruss
Last active August 29, 2015 14:01
Show Gist options
  • Save aruss/997c92b499ea8a11ceae to your computer and use it in GitHub Desktop.
Save aruss/997c92b499ea8a11ceae to your computer and use it in GitHub Desktop.
AngularJs snipptes
(function(app, $) {
app.directive('fooBar', function($timeout) {
return {
link: function(scope, elm, attrs) {
elm.on('public.action', function(e) {
// do stuff, call it by $('#elm').trigger('public.action');
});
// awesome directive is awesome
}
};
});
})(angular.module('someApp'), angular.element);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment