Beta 14: customised back button not working


#1

Just upgraded to beta 14 and back button does not seem to work when it is customised
If I just have a back button tag like

<ion-nav-back-button/>

it navigates back to the previous view

but if I customise it like

<ion-nav-back-button class="button-clear"  ng-click="goBack()"><i class="ion-ios7-arrow-back"></i>
</ion-nav-back-button>

with event

$scope.goBack = function () {
        $ionicNavBarDelegate.back();
};

the event fires but fails with the following error

deprecatedWarning (http://localhost:8100/lib/ionic/js/ionic.bundle.js:47077:13)
at self.back (http://localhost:8100/lib/ionic/js/ionic.bundle.js:47068:5)
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:105:46
at Array.forEach (native)
at DelegateInstance.caller [as back] (http://localhost:8100/lib/ionic/js/ionic.bundle.js:102:27)
at Scope.$scope.goBack (http://localhost:8100/js/controllers/events/design-controller.js:149:34)
at $parseFunctionCall (http://localhost:8100/lib/ionic/js/ionic.bundle.js:20124:18)
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:50863:9
at Scope.$eval (http://localhost:8100/lib/ionic/js/ionic.bundle.js:22178:28)
at Scope.$apply (http://localhost:8100/lib/ionic/js/ionic.bundle.js:22276:23)ionic.bundle.js:19387 (anonymous function)


#2

I just read in the release notes

$ionicNavBarDelegate#back: The back() method has been removed in favor of using $ionicHistory.goBack(). Additionally, $ionicGoBack() is added to the rootScope. $ionicHistory docs

I will change to $ionicHistory.goBack()