You need to use a link function in your directive:
link: function(scope, element, attrs) {
element.on('click', function() {
$window.history.back();
});
}
See jsFiddle.
More Related Contents:
- Why are Callbacks from Promise `.then` Methods an Anti-Pattern
- How to display length of filtered ng-repeat data
- Clicking a button within a form causes page refresh
- How to dynamically change header based on AngularJS partial view?
- Request header field Access-Control-Allow-Headers is not allowed by Access-Control-Allow-Headers
- What’s the recommended way to extend AngularJS controllers?
- Losing scope when using ng-include
- SyntaxError: Unexpected token o in JSON at position 1
- How does the $resource `get` function work synchronously in AngularJS?
- angularjs: allows only numbers to be typed into a text box
- Using Jquery Datatable with AngularJs
- How do I use Bluebird with Angular?
- Accessing $scope in AngularJS factory?
- Angularjs: call other scope which in iframe
- Angular ui router unit testing (states to urls)
- What is the angularjs way to databind many inputs?
- Angular.js: set element height on page load
- AngularJS: How do I manually set input to $valid in controller?
- How can I handle browser tab close event in Angular? Only close, not refresh
- Using jqgrid with popover from angular ui bootstrap
- how to change the headers for angularjs $http.jsonp
- How can I access the value of a promise?
- Open links in new window using AngularJS
- AngularJS ng-src inside of iframe
- What is the difference between $scope.$root and $rootScope?
- Call angularjs function using jquery/javascript
- Pass parent scope value into ng-repeat loop in Angular
- Sort or Rearrange Rows of a table in angularjs (drag and drop)
- Blob download is not working in IE
- Angular.js: Is .value() the proper way to set app wide constant and how to retrieve it in a controller