I have directive which is site header with back button and I want on click to go back to the previous page. How do I do it in the angular way?
I have tried:
There was a syntax error. Try this and it should work:
directives.directive('backButton', function(){ return { restrict: 'A', link: function(scope, element, attrs) { element.bind('click', function () { history.back(); scope.$apply(); }); } } });