# Modal affects lifecycle

**URL:** <https://forum.ionicframework.com/t/modal-affects-lifecycle/61954>\
**Category:** ionic-v3\
**Created:** [August 29, 2016, 6:46pm UTC](https://forum.ionicframework.com/t/modal-affects-lifecycle/61954 "2016-08-29T18:46:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ekhmoi](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ekhmoi/32/103413_2.png) [@ekhmoi](https://forum.ionicframework.com/u/ekhmoi)\
**Post date:** [August 29, 2016, 6:46pm UTC](https://forum.ionicframework.com/t/modal-affects-lifecycle/61954/1 "2016-08-29T18:46:04Z")

</div>

Hello!  
I’m building an application using ionic 2 and have faced a little problem.  
I have a logic which runs on ‘ionViewDidEnter’.  
however every time that i open a ModalController from that page, when Modal dismiss it triggers ‘ionViewDidEnter’ again.

i tried to use ‘ionViewLoaded’ but it will only run my code once when i first visit that page.  
I need to run the logic every time i navigate between tabs ( not when Modal dismiss)

do you have any idea how can i do this ?
