Skip to content

Instantly share code, notes, and snippets.

@henryspivey
Created October 23, 2016 21:53
Show Gist options
  • Save henryspivey/6d4a8fad4c1e17514e1eda944e8f5d0a to your computer and use it in GitHub Desktop.
Save henryspivey/6d4a8fad4c1e17514e1eda944e8f5d0a to your computer and use it in GitHub Desktop.
Simple Custom Backbutton in angular js for Ionic
.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