refactor(ionNavBackButton): only set scope variable when needed

This commit is contained in:
Andy Joslin
2014-03-19 16:42:10 -06:00
parent e94d400648
commit b70543b78d

View File

@@ -316,8 +316,8 @@ function($ionicViewService, $rootScope, $animate, $compile, $parse) {
compile: function(tElement, tAttrs) {
tElement.addClass('button back-button');
return function($scope, $element, $attr, navBarCtrl) {
$scope.$navBack = navBarCtrl.back;
if (!$attr.ngClick) {
$scope.$navBack = navBarCtrl.back;
$ionicNgClick($scope, $element, '$navBack($event)');
}