Skip to content

Instantly share code, notes, and snippets.

@ZachMoreno
Created July 13, 2012 01:24
Show Gist options
  • Select an option

  • Save ZachMoreno/3102169 to your computer and use it in GitHub Desktop.

Select an option

Save ZachMoreno/3102169 to your computer and use it in GitHub Desktop.
myModule.directive('myComponent', function(mySharedService) {
return {
restrict: 'E',
controller: function($scope, $attrs, mySharedService) {
$scope.$on('handleBroadcast', function() {
$scope.message = 'Directive: ' + mySharedService.message;
});
},
replace: true,
template: '<input>'
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment