Run a controller function whenever a view is opened/shown

后端 未结 9 1593
滥情空心
滥情空心 2020-12-01 02:28

I\'m building an app with angular+ionic that uses a classic three-button menu at the bottom with three ion-tabs in it. When a user clicks a tab, that template opens through

9条回答
  •  孤独总比滥情好
    2020-12-01 02:53

    This is probably what you were looking for:

    Ionic caches your views and thus your controllers by default (max of 10) http://ionicframework.com/docs/api/directive/ionView/

    There are events you can hook onto to let your controller do certain things based on those ionic events. see here for an example: http://ionicframework.com/blog/navigating-the-changes/

提交回复
热议问题