From f949a44d41b439138b84336e0f3d12784746f44d Mon Sep 17 00:00:00 2001 From: "Robert (Jamie) Munro" Date: Mon, 9 Feb 2015 11:31:53 +0000 Subject: [PATCH] Fix "'Cannot set property 'forwardViewId' of undefined'" As found here: http://forum.ionicframework.com/t/cannot-set-property-forwardviewid-of-undefined/15512/2 --- js/angular/service/history.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/angular/service/history.js b/js/angular/service/history.js index 2d42e8bef4..b180ac6cc9 100644 --- a/js/angular/service/history.js +++ b/js/angular/service/history.js @@ -391,6 +391,10 @@ function($rootScope, $state, $location, $window, $timeout, $ionicViewSwitcher, $ if (hist.stack[x].viewId == viewId) { action = 'dupNav'; direction = DIRECTION_NONE; + if (x != 0) { + hist.stack[x - 1].forwardViewId = null; + } + viewHistory.forwardView = null; hist.stack[x - 1].forwardViewId = viewHistory.forwardView = null; viewHistory.currentView.index = viewHistory.backView.index; viewHistory.currentView.backViewId = viewHistory.backView.backViewId;