Skip to content

Instantly share code, notes, and snippets.

@ChaseFlorell
Created March 19, 2014 20:12
Show Gist options
  • Select an option

  • Save ChaseFlorell/9650191 to your computer and use it in GitHub Desktop.

Select an option

Save ChaseFlorell/9650191 to your computer and use it in GitHub Desktop.
'use strict';
myApp.directive('backButton', function () {
return {
restrict: 'E',
link: function (scope, element, attrs) {
element.bind('click', goBack);
function goBack() {
history.back();
scope.$apply();
}
}
};
});
@ChaseFlorell

Copy link
Copy Markdown
Author

simple back button directive for angularjs 1.2x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment