Created
March 4, 2018 10:07
-
-
Save mido1983/40b1eaf9f8c7c5d7068a7361adae687b to your computer and use it in GitHub Desktop.
AngularJS buttons using history.back()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app.directive('backButton', ['$window', function($window) { | |
| return { | |
| restrict: 'A', | |
| link: function (scope, elem, attrs) { | |
| elem.bind('click', function () { | |
| $window.history.back(); | |
| }); | |
| } | |
| }; | |
| }]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <a href back-button>back</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment