Skip to content

Instantly share code, notes, and snippets.

@victorb
Created February 7, 2014 18:37
Show Gist options
  • Select an option

  • Save victorb/8868919 to your computer and use it in GitHub Desktop.

Select an option

Save victorb/8868919 to your computer and use it in GitHub Desktop.
tr {
position: relative;
}
.clicky {
position: absolute;
opacity: 0;
}
<!DOCTYPE html>
<html ng-app="jsbinApp">
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.1/angular.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div ng-controller="IndexCtrl">
<table>
<thead>
<tr>
<td>ID</td>
<td>Value</td>
</tr>
</thead>
<tbody>
<tr clicky>
<td>1</td>
<td>Five</td>
</tr>
<tr clicky>
<td>2</td>
<td>Six</td>
</tr>
</tbody>
</table>
{{ message }}
</div>
<script>
console.clear();
var app = angular.module('jsbinApp', [])
.controller('IndexCtrl', function($scope) {
$scope.message = "Asd";
})
.directive('clicky', function() {
return {
restrict: 'A',
transclude: true,
replace: true,
template: ,
link: function(scope, element, attr, ctrl) {
element.bind('click', function(event) {
window.location = 'http://www.google.com';
});
}
}
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment