Created
October 23, 2016 21:53
-
-
Save henryspivey/6d4a8fad4c1e17514e1eda944e8f5d0a to your computer and use it in GitHub Desktop.
Simple Custom Backbutton in angular js for Ionic
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
.directive('backButton', ['$ionicHistory',function($ionicHistory){ | |
return { | |
restrict: 'E', | |
template: "<button class='button button-clear' id='customBackButton'><i class='button-icon icon ion-ios-arrow-left'></i> Back</button>", | |
link: function($scope, element, attrs) { | |
element.bind('click', function(){ | |
$ionicHistory.goBack(); | |
}) | |
} | |
} | |
}]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment