Skip to content

Instantly share code, notes, and snippets.

@denisos
Created December 1, 2013 00:56
Show Gist options
  • Save denisos/7727300 to your computer and use it in GitHub Desktop.
Save denisos/7727300 to your computer and use it in GitHub Desktop.
angular js directive to show info and handle click
angular.module('directive.contact-brief'
, [])
.directive('contactBrief', [function(Events) {
return {
restrict: 'E',
scope: {
contact:'=contact' // we expect a contact object passed in
},
templateUrl: '../contact-brief.html',
replace: true,
link: function(scope, element, attrs) {
// when user clicks link then show x
$('a.contact-name', element).click(function() {
// its clicked do something;
});
}
};
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment