Screen orientation problem in ionic

Hi everyone,
I’m using the screen orientation in ionic app , i,m using the event “$ionicView.afterEnter” for changing the orientation to landscape and “$ionicView.beforeLeave” to change to portrait by clicking the one icon in app, it works fine. on first time it works but again click on icon redirect to page and change orientation at that time click on ion-nav-button app crashes(closed). Please help to solve this issue.

   Thanking you....