Skip to content

Instantly share code, notes, and snippets.

@ChaseFlorell
Created March 19, 2014 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChaseFlorell/9650191 to your computer and use it in GitHub Desktop.
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
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